Chrome Extensions in Gmail, autosave removes it - google-chrome-extension

I'm trying to write a chrome extension that is used in the GMail compose screen. So far I have it working the way I want to except that when the GMail does its auto-save it removes my extension.
I'm adding in my extension with the content_script via java inject. and appending to the compose iframe.
Any help would be appreciated :)

You have to track DOM changes and re-add your code after the auto-save. There is another answer that gives a quick intro to DOMNodeInserted events. You should be able to watch for the Draft saved at ... insert.

Related

How to make a Chrome Extension available on all tabs while on development (unpacked)?

I just started developing a small Chrome extension, and following the https://developer.chrome.com/extensions/getstarted tutorial, I tried to find a way so that even in developer mode, the extension can be clickable on all tabs.
Right now, the extension is clickable only on pages under developer.chrome.com host.
It's probably a silly question, but do we have the possibility to test it, while on development, on other tabs (not under developer.chrome.com host)? If yes, how do we set this options? I try to add <all_tabs> permission in the manifest, but it doesn't seem to work.
Thanks!
The problem was that following this tutorial https://developer.chrome.com/extensions/getstarted, a rule is set in the background.js file that the browser action to execute on other pages.
I had to add the activeTab permission and delete code from background.js.
Credit to: https://www.sitepoint.com/create-chrome-extension-10-minutes-flat/
As available here https://developer.chrome.com/extensions/user_interface#browser_action, adding browser_action to your manifest.json as against adding page_action makes the extension available in all tabs.

Retrieve History of a specific Tab in chrome [duplicate]

I am developing a little extensions called "Tab Bundler", which in short saves all the open tabs in a window into a bundle that can be opened with the click of a button. When a bundle is opened however, no history of how the user got to that url is saved, ie. the user can't click back to see how they got to that url. This is functionality I want to implement. I looked for a while, googling, looking thoroughly through the google chrome extension documentation: http://code.google.com/chrome/extensions/history.html. But I couldn't figure out how to get this information without tracking it myself. Is that the only option I have? Any thoughts would be really appreciated.
Thanks!
Look, many people tried this before. You are not alone in this quest!
At the moment the answer in Google Code was: anybody asked for it when they where developing the History API. Then there's no elegant way to access tabs' history.
Of course, you can hook chrome.tabs.onUpdated to record every page and make your own tab's history...
You could probably hook chrome.tab.onUpdate as well as some state or focus change hook to correlate.
I really want this, please make it!

Writing Gmail Chrome Extesion

I'm interesting in developing Chrome Extension for Gmail.
Unfortunately I couldn't find any tutorials on this subject (demonstrating a simple action as adding a button).
I'm looking for adding a button to the compose toolbar, and creating a new tag/folder in gmail account.
Please, Help!
You should check out these APIS at https://github.com/joscha/gmailr, it is a fork of https://github.com/jamesyu/gmailr but the original author has been too busy to update it.

Detect if a tab was POSTed to from Google Chrome extension

Is there a way to detect if a particular tab was POSTed to via a Google Chrome extension? I am working on an extension that includes an "undo closed tab" type of function and would like to handle tabs which were POSTed to differently than GET pages.
I believe a solution exists in chrome.webRequest.onBeforeRequest via the 'method' return parameter. I will report back with a working code example once I have time to try this out.

Closing tabs when a chrome extension is disabled/reloaded

I have a Chrome extension that opens a number of tabs, which it keeps open and uses to display data. I want those tabs to close when the extension is disabled or reloaded. My initial thought was that background.html would be unloaded when I restarted the plugin, but I can't seem to get anything that involves this to work. Any suggestions?
Chrome automatically closes pages with chrome-extension://<your_extension_id>/local.html urls (pages from the extension directory) when an extension is disabled. So if you can display your data using those pages - they will get closed. If it is some external site you are displaying - maybe you can make a local stub page with iframe and load your external site there.
Otherwise I can't think about any other way (besides having another extension watching this one).
i dont' know so much about chrome extensions, but, I think you are openning new windows by something like var w = window.open(params), so, you can close the window with w.close().
if not, ignore my answer :P

Resources