Open Bug 1805687 Opened 2 years ago Updated 18 days ago

Can't execute script having activeTab permission after page reload

Categories

(WebExtensions :: Untriaged, enhancement, P3)

Firefox 107
enhancement

Tracking

(firefox108 affected, firefox109 affected, firefox110 affected)

Tracking Status
firefox108 --- affected
firefox109 --- affected
firefox110 --- affected

People

(Reporter: maximtop, Unassigned)

References

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

Attached file extension.zip

Steps to reproduce:

  1. install the extension from the attached files
  2. go to example.org
  3. open browser action
  4. click "reload"
  5. click "execute script"

Actual results:

page reloaded, but the script didn't execute, in the console wasn't printed 'hello from content script'

Expected results:

page reloaded and the script executed (printed in console 'hello from content script')

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

Hello,

I reproduced the issue on the latest Nightly (110.0a1/20221215195521), Beta (109.0b3/20221215185833) and Release (108.0/20221208122842) under Windows 10 x64 and Ubuntu 16.04 LTS.

Following the STR and clicking “execute script” will not print “hello from content script” in the console. Page reload works.

See the attached screenshot for more details.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image 2022-12-16_09h36_30.png
Severity: -- → N/A
Type: defect → enhancement
Priority: -- → P3
Whiteboard: [addons-jira]

FYI: Chrome has the expected behavior. The activeTab permission sticks around as long as the tab is same-origin compared to the initial state of the tab. E.g. after reloading or navigation to different path at same origin, activeTab sticks around, judging by successful execution of tabs.executeScript.

This was recently mentioned in an inconsistency issue on the WebExtensions Community Group: https://github.com/w3c/webextensions/issues/657.

In Chrome: If you click an extension icon on a tab on which you have not granted host permissions, it requires that you refresh the page before it will load the extension. You can reload the page as many times as you want without permanent host permissions and it will load the extension each time, until you close the tab.

In Firefox: If you click the extension icon on a tab on which you have not granted host permissions it automatically loads the extension. If you refresh the page, it requires another click.

This was also previously reported in bug 1535803, which was closed as "expected behavior."

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: