Why page-realod is required to use/access newly installed/enabled extension?

126 views
Skip to first unread message

Muaz Khan

unread,
Oct 22, 2014, 10:22:33 PM10/22/14
to chromium-...@chromium.org
  1. Page reload is always required to make sure chrome extension can contact with "current-opened-tab". This happens when a tab is already opened, and you try to install an extension.
  2. If tab is opened, and you disable extension, "web_accessible_resources" are still accessible. The only unreliable way to detect if chrome extension is enabled/disabled is by passing postMessage data between content-scripts and the webpage.
I simply want following behaviors:
  • I want to make sure that if a tab is already opened, and if a chrome extension is "enabled"; the tab must be able to reach that newly "enabled" extension. This doesn't seems to be possible in the moment because page-reload is required in two situations: 1) if a chrome extension is installed and 2) if a chrome extension is enabled using chrome://extensions page.
Maybe it s a known behavior. Maybe there are some existing discussions regarding same issue. Kindly please link those resources because I didn't able to find them.

To test such behavior:
Regards

Wolf War

unread,
Oct 23, 2014, 5:44:17 AM10/23/14
to chromium-...@chromium.org
Extensions (not all) for their purpose must inject script (JS code) into web page that is opened in tab. For instance, to listen mouse moves, clicks etc...
In your example, JS code from extension is not injected in currently opened pages. Code needed to do some job, whatever that is, and thus, tab needs to be reloaded...
(I guess, didn't test it and don't know how logic of that particular extension works)
Some developers will force auto reload of all currently opened tabs upon extension installation... but that's not very good practice
Reply all
Reply to author
Forward
0 new messages