You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on chrome plugin for GMail in this week, and at first I'm assigned
to make a tooltip that's shown when an email address is mouse over, and hidden once
move out of that element.
The interaction is same to gmail's user card, so if I was following this, it may be
mess to users because of two "card" that will be shown simultaneously.
Ok, This is the problem that I met in this week, let's address the issue more gracefully.
Caveat
Gmail's user card is an iframe tag within a different domain from gmail's like below:
Gmail: mail.google.com
UserCard: apis.google.com
So when you try to access that anything in the cross-domain iframe's document by:
in your plugin scripts, then run it, now you are able to get document and do any DOM injection based on
this document such as add a line of your company name, change the card avatar etc.
I was working on chrome plugin for GMail in this week, and at first I'm assigned
to make a tooltip that's shown when an email address is mouse over, and hidden once
move out of that element.
The interaction is same to gmail's user card, so if I was following this, it may be
mess to users because of two "card" that will be shown simultaneously.
Ok, This is the problem that I met in this week, let's address the issue more gracefully.
Caveat
Gmail's user card is an
iframe
tag within a different domain from gmail's like below:So when you try to access that anything in the cross-domain iframe's document by:
It will prints the error by chrome:
This is prohibited by any HTTP browsers of course included chrome, but chrome plugins are the buster.
Plugin Permission
In
manifest.json
, I just added one domain like this:Okay, then write:
in your plugin scripts, then run it, now you are able to get document and do any DOM injection based on
this document such as add a line of your company name, change the card avatar etc.
In fact the
permission
field will be used at firefox add-on, for more details you could visit:https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json
The text was updated successfully, but these errors were encountered: