Content.js now need permissions on each matching URL

For example my https://ff.chatgptautocontinue.com and https://ff.chatgptwidescreen.com now has a blue dot on the toolbar icon, then only when user clicks, do the content.js load on chatgpt.com

Pre-click:

image
image

Post-click:

This is very bad for UX, how to fix?

The dot is shown when your addon “want’s” to run on the current page but doesn’t have the host permission for doing that.
For example, when the host is listed in the optional_host_permissions list. This was introduced only recently:

To fix it, you need put the host to the host permissions array:

Also, content scripts registered through the manifest file will automatically get the host permission.

Sup @juraj.masiar, thank you for trying to help, you are a true Friend of Add-ons!

I tested adding "host_permissions": ["https://chatgpt.com/*"], but it didn’t work, also the post you linked was last updated 2024-07-17, and I never had blue dot problem until recently (extension was published in September, after July)

Also you said “content scripts registered through the manifest file will automatically get the host permission” anyway and my content_scripts is already:

  "content_scripts": [{
    "matches": [ "https://chatgpt.com/*", "https://www.perplexity.ai/*", "https://poe.com/*" ],
    "run_at": "document_end", "js": [ "content.js" ]
  }],

…and this problem doesn’t occur in Chrome, so all this leads me to believe a recent FF update is the culprit

You are a funny man, thanks! :smiley:

Could you post the whole manifest file here?
Also, any chance you are removing host permissions using code? :slight_smile:

The dot issue still exists, for example if you have optional <all_urls> permission.

But it sounds super strange… the dot should only appear when you don’t have host permission for the currently viewed page, so are you sure the tab URL is chatgpt.com?

Also, I’ve just tested it in one of my MV3 addons, removing host from host_permissions array doesn’t break it for the host as long as the content script is registered for the host.

Yes it is @ https://github.com/adamlui/chatgpt-widescreen/blob/main/firefox/extension/manifest.json

{
  "manifest_version": 3,
  "name": "__MSG_appName__",
  "short_name": "ChatGPT 🖥️",
  "description": "__MSG_appDesc__",
  "version": "2024.11.12",
  "author": "Adam Lui",
  "homepage_url": "https://www.chatgptwidescreen.com",
  "default_locale": "en",
  "icons": {
    "16": "icons/icon16.png",
    "32": "icons/icon32.png",
    "48": "icons/icon48.png",
    "64": "icons/icon64.png",
    "128": "icons/icon128.png",
    "223": "icons/icon223.png"
  },
  "permissions": [ "activeTab", "storage" ],
  "action": { "default_popup": "popup/index.html" },
  "web_accessible_resources": [{
    "matches": [ "<all_urls>" ],
    "resources": [ "lib/chatgpt.js", "lib/dom.js", "lib/settings.js" ]
  }],
  "content_scripts": [{
    "matches": [ "https://chatgpt.com/*", "https://www.perplexity.ai/*", "https://poe.com/*" ],
    "run_at": "document_end", "js": [ "content.js" ]
  }],
  "background": { "scripts": [ "background.js" ]},
  "browser_specific_settings": {
    "gecko": { 
      "id": "chatgpt.widescreen@chatgptevo.com",
      "strict_min_version": "109.0"
    }
  }
}

No I don’t believe so

I tested using both <all_urls> and https://chatgpt.com/* for host_permissions but no dice

Indeed the root domain is chatpgt.com, also same new problem occurs on perplexity.ai

My content_scripts includes matches for all 3 AI sites the content.js is intended to run on (and has always worked until sometime past week or longer)

I think we’ll need a new pair of eyes here because I’m out of ideas :upside_down_face:.
Unless you are using some old Firefox?
Or maybe you’ve misclicked a context menu on the toolbar icon?
image

1 Like

Wait it was checked like that by default? I’m on latest FF and just tried removing/re-installing and it defaults to “Only When Clicked” for me :frowning:

I just changed to “Always Allow on chatgpt.com”, removed extension, then re-installed and it worked!!!

So if not a bug, it is at least undesirable that this context menu setting persists even when extensions are removed (it should stick w/ default behavior on fresh install) do you agree?

Note that the “true” re-installing requires restarting Firefox after uninstalling, otherwise data/settings are not really deleted when you install it back.

Ok I trust you since I fear restarting FF since it takes forever to boot up previously open tabs, thank you for the solution!

1 Like