Giter Club home page Giter Club logo

gmail.js's People

Contributors

andreilavrenyuk avatar avzabr avatar brentkelly avatar cancan101 avatar catmanjan avatar courthead avatar dependabot[bot] avatar ek23 avatar fabi1sc avatar generalzero avatar ginotria avatar hankypanky666 avatar huksley avatar jerrybels avatar josteink avatar kartiktalwar avatar leecunliffe avatar liquidmetal avatar lirikooda avatar lsgd avatar madhugb avatar michi88 avatar navega avatar neomarbassani avatar onestep avatar shashikiran-im avatar srastanka avatar wearhere avatar xavi- avatar yevhene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmail.js's Issues

Missing: gmail.dom .compose()

Great job so far on this api, thank you! Noticed that gmail.dom .compose() seems to be missing in the master branch? I was looking for a way to programmatically pop open the compose screen and hopefully specify the subject,body, and recipients. Thanks for your help!

Example for toggle_threads for gmail.observe.on

I am using your js file to get the From emails of opened email(multiple threads), but i need to change the email id when user toggled a different thread like rapportive. I tried to use toogle_threads in this way
gmail.observe.on("toggle_threads", function(id, url, body) {
console.log("id:", id, "url:", url, 'body', body);
});
But it didnt worked

Need help for a Chrome Extension, on adding a widget for GMail.

Greetings.!

We are a team of avid Google Chrome extension developers. There are a few Chrome extensions we’ve developed that are already in the Chrome store.
At the moment we are working on a new project - developing a Chrome extension for gMail, and we want to add a widget to the left side rail panel along with the Google Chat, Quick Links etc..

we want to know if there is a correct way of adding a Gadget / Widget to this part of the UI

If not; is it possible to notify the gMail internal JavaScript about the status of the Widget (i.e.whether its Open or Closed)
What we need is some JS interface points:

  1. How can we get the height of the widget?
  2. How can we attach an event handler when an existing widget is loaded/opened (to hide our widget)
  3. Is there a function / event-fire to notify the gMail code when our widget is opened

It would be deeply appreciated if you can shed some light on these matters.

Handle composition/reply/forward

Hi,

Currently there are two observers to handle email data at its creation.

  • send_message, even though it doesn't seem to include the new email content ;
  • show_newly_arrived_message which doesn't seem to work for me, in the way that I expect it to trigger a callback when the new email enters the current thread.

By creation I mean one of these :

  • composition of a new email, performed in a dedicated popin (which in turn has several display configurations) ;
  • reply to/forwarding of a previous email, performed right under it (or in popin mode too).

It would be nice to access relevant elements whenever the user starts editing an email. I know this looks UI-oriented, but as it actually triggers draft saving and whatnot as background routine, I'd have thought maybe there's something to track there.

Maybe my use case is a bit too specific, but I try to include a custom control in the body of the edited content (like a custom button), then perform extension-related things using the new content. Finally I try to take into account the new email in the thread right away.

So here we have three relevant things to wish an access for:

  • a DOM element for the edition "frame", that would be found in api.dom ;
  • an observer for the submission event, in api.observe, passing the new content ;
  • an observer for the integration of the new email in the current thread.

What do you think of this?
Am I missing something already here, or asking too much?
Anyway I don't expect it to be obvious.

Thanks.

[BUG] `is_deleted` has false positives in `api.get.email_data()`

So this is a part extension of #39, where 'folded' emails don't contain the email's meta data when running api.get.email_data(). The check for detecting deleted emails in #41 is checking the existence of the meta data. This intersection returns false positives.

Possible solution:

Sift through api.tracker.email_data after calling api.get.email_data() and detect what elements are present/not present in a deleted message vs undeleted message. Instead of doing the x[13] == undefined check

gmail.get .email_id()

If conversation view is enabled in gmail, this API is retuning the id of the first email in that thread (looks like the id from location hash)..It will be great if it can return the id of the email that is currently opened in the conversation..
(By default its the last email in the conversation)

Internationalization

For now, by looking at the code, only US English interface is supported as some elements are explicitly referred through their attributes values (like "Inbox").

However, when another locale is in use, some functionalities are supposed to fail.
For example, "Inbox" becomes "Boîte de réception" in French. This results, among other things, in a counting of inbox unread emails being 0 while there are some.

Does it seem a probable thing, in a near future, to support the interface regardless of the language? Maybe by refactoring all such attribute values and picking the actual values using an initial locale parameter.

That may not be a priority, but as I know I'll need that very soon, I might consider proposing a solution. If it's planned then, awesome.

Delete emails

Please add a function to delete emails. I have some folders with several tens of thousands of emails and gmail will always eventually respond with some error code if I try to delete them all at once.

A way to run a loop which 1. select all emails on a page 2. deletes them, until there are no more emails in this folder/label would finally help me to get rid of them.

The corresponding shortcut would be *a#.

How to modify the body before send?

I have tried various ways to modify the body in gmail.observe.before('send_message'... but am not having any luck. It seems that modifying the body prevents gmail from sending the message. Modifying the subject as per boilerplate works fine, however.

Is it possible to do this?

Gmail() is undefined

I'm writing a chrome extension and trying to incorporate Gmail.js.
I have jquery injected in the manifest under content scripts first, then gmail.js, then my content script - which has the following line at the top...
var gmail = Gmail();

For some reason, on trying to use gmail.get.user_email(); in chrome dev tools JS console, I get gmail is not defined though it is evident that the content script is executing based on effects of code blocks of other lines of the content script being seen in the view.

GLOBALS is not defined

Anyone else experiencing this error, and/or have a solution for it?

ReferenceError: GLOBALS is not defined
at Gmail (http://localhost:3000/js/mvc.js:45:130)
at Scope.$scope.listMessages (http://localhost:3000/js/mvc.js:47:17)
at http://localhost:3000/js/angular.js:10822:21
at http://localhost:3000/js/angular.js:19816:17
at Scope.$eval (http://localhost:3000/js/angular.js:12724:28)
at Scope.$apply (http://localhost:3000/js/angular.js:12822:23)
at Scope.$delegate.proto.$apply (:855:30)
at HTMLButtonElement. (http://localhost:3000/js/angular.js:19815:21)
at http://localhost:3000/js/angular.js:2890:10
at forEach (http://localhost:3000/js/angular.js:327:20) tracker.js:8
a.(anonymous function) tracker.js:8
(anonymous function) angular.js:10033
(anonymous function) angular.js:7394
Scope.$apply angular.js:12824
$delegate.proto.$apply VM2309:855
(anonymous function) angular.js:19815
(anonymous function) angular.js:2890
forEach angular.js:327
eventHandler angular.js:2889
d.util.hasFunction.f.(anonymous function)

Gmail blocking third party scripts?

I'm not sure if this is a known issue, but I don't see any notice of it so I'm posting an issue:

Attempting to inject via console throws the error below. It looks like gmail is blocking all third party scripts?

[Report Only] Refused to load the script 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://talkgadget.google.com/ https://www.googleapis.com/appsmarket/v2/installedApps/ https://www-gm-opensocial.googleusercontent.com/gadgets/js/ https://docs.google.com/static/doclist/client/js/ https://www.google.com/tools/feedback/ https://s.ytimg.com/yts/jsbin/ https://www.youtube.com/iframe_api https://ssl.google-analytics.com/ https://apis.google.com/_/scs/abc-static/ https://apis.google.com/js/ https://clients1.google.com/complete/ https://apis.google.com/_/scs/apps-static/_/js/ https://ssl.gstatic.com/inputtools/js/ https://ssl.gstatic.com/cloudsearch/static/o/js/ https://www.gstatic.com/feedback/js/ https://www.gstatic.com/common_sharing/static/client/js/ https://www.gstatic.com/og/_/js/".

Getting sender email?

Is it possible to grab the sender email from the inbox index view of the GMail interface?

gmail.observe .on(action, callback) not working?

I have put together some code for using gmail.js as part of a chrome extension. It all seems to work just fine, however none of the gmail.observe functions seem to do anything. I have tried entering them into the console just as you have outlined in the readme.

Example:

gmail.observe.on("star",function() {
   console.log("it worked"); 
} );

When I then star an email, nothing happens. Am I using this wrong or is it a bug?

gmail.dom.composes() is undefined

Hey,

We are looking to modify the dom of compose windows but it looks like the DOM function for Compose(s) is unavailable in the newest release?

> gmail.dom
< Object {inbox_content: function, inboxes: function, email_subject: function, email_body: function, email_contents: function…}
> gmail.dom.composes()
< TypeError: undefined is not a function

Too many )

There is an additional ')' on line 645 of gmail.js in the latest commit.

Email data with conversation view off

Hi there,

In #43 and #44 we dealt with email status, and the need to differentiate what's fully visible / partially visible / hidden / deleted in a conversation.

But I had not thought about the case when conversation view is off (via settings), in which each email is seen in separate views. But even then, metadata include the whole thread and what the user sees is not what is actually handled.

I don't remember if it's been mentioned before, but a is_in_current_view email property would be nice.

Or maybe an alternative way of parsing emails (like api.get.current_email_data()).

DOM Observer for recipient_change not working

I added this code (as per the readme file), and nothing is logged to the console window when I add or change recipients in a new compose window:

gmail.observe.on('recipient_change', function(match, recipients) {
  console.log( 'recipients changed', match, recipients);
});

Does it support multi-account gmail interface ?

Does Gmail support for multi account detection ?

A Gmail user can login to multiple accounts at a time and switch UI accordingly. We want to display some plugin data based on current gmail account.

How do we identify which email account is open right now, Dos the gmail.js object instance has ability to identify this when it would become a part of some chrome extension ?

get email data

"Get email data" is missing to, cc and bcc..Instead you have "people involved" ..Is this a limitation?

Add gmail.observe.on("hover_email", callback)

You may have heard that raplets inside of rapportive are being deprecated, I'm looking to build a drop in replacement chrome plugin which is compatible with the raplet spec, and this lib looks like it could do almost all of the heavy lifting. All it's needs is a way of observing when an email is hovered when inside a thread, either an email address in the to, cc, or bcc fields, or an email within the email body.

Example of using gmail.observe.http_requests() ?

Would you be able to give an example of how to use this and access the different parameters of the requests? I'm presuming it can be used to access the details of the most recently sent email?

Thanks for creating this btw, it is really useful!

Deleted emails get parsed

Hi,

In a context of threaded emails, you can delete specific emails and thus they get removed from that thread.

However, when using gmail.get.email_data(), all emails are considered, including the deleted ones.
That may be a good thing when it comes to handling all emails of a thread regardless of their deletion state.

But when it comes to actually parsing what's currently here on the interface, it's a problem.

I thought it could be an option, to ask for emails including or excluding the deleted ones.

In the process, I guess that would be a separate issue but as it's about deletion...
Is it / would it be possible to observe deletion events on individual emails, not entire threads?

Thanks. (:

modify url parameters on POST request

I'm building an app that requires modifying email body. The url.cmml parameter represents the length of body string. If body is changed, url.cmml needs to be updated to new body length, otherwise gmail server will not send the email.

I saw the comments in api.tools.xhr_watcher():

// TODO: recreate the url if we want to support manipulating url args (is there a use case where this would be needed?)

However, url is passed in win.XMLHttpRequest.prototype.open(), while email body is passed in win.XMLHttpRequest.prototype.send(). If I modify the body, I only find out about body in send(), which happens after open().

Any ideas on how to handle this?

"to" array empty for "older" messages

When reading an email, previous emails are folded (i.e. their content is hidden).
You can have two levels of folding: simple (for the first and penultimate ones, when more than 3 previous emails) and grouped for all those in between.

However the to array isn't filled with recipients' email addresses for those in grouped folding.

Q: Reading/parsing xhr response

Hello,

I have an observer for the send_message event where I can get data like the composeid and draftid. But for my use case, I would also want to get the email Id of the sent email.

Upon checking the xhr response for the send_message request the email id is indeed included. Is there a way to read and parse these responses like how xhr_watcher is doing?

Thanks,
Gino

Include "version" property in API

I suggest keeping track of the version number of gmail.js, and making that accessible via the API, so users can do:

gmail = Gmail();
gmail.version  // returns "1.0.0" or something similar

jQuery enables something similar with jQuery().jquery.

How to know which emails are expanded

Hey! Awesome lib...any chance when you get the threads to know which are open, and which aren't?

Also, any idea when the expand_email event will be stable?

Gmail.js not loading fast enough

I'm attempting to write a chrome extension using Gmail.js. Thank you!

I use the sample code:

var gmsrc = document.createElement('script');
gmsrc.src = "https://xmailchrome.appspot.com/gmail.js";
document.getElementsByTagName('body')[0].appendChild(gmsrc);
console.log("Scripts loaded, Start playing ...");

But when I start playing it says: Uncaught reference error: Gmail is not defined.

In the chrome console, after the script is ran... Gmail is defined. Just not when the code below 'start playing' is ran.

Basically I just want to use the Gmail.js onload.

Thanks!

GLOBALS is not defined

api.tracker.globals = GLOBALS;

Uncaught ReferenceError: GLOBALS is not defined. What should I be doing to fix this?

Passing Gmail.js information to Popup

Gmail.js must be run in a content script for chrome extensions. How would I pass the information from Gmail.js to the popup of the main extension?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.