Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: A persistOnNavigation property for the action API #480

Open
newRoland opened this issue Oct 29, 2023 · 0 comments
Open

Proposal: A persistOnNavigation property for the action API #480

newRoland opened this issue Oct 29, 2023 · 0 comments
Labels
follow-up: chrome Needs a response from a Chrome representative proposal Proposal for a change or new feature supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari

Comments

@newRoland
Copy link

newRoland commented Oct 29, 2023

Context

From an active Chromium issue, reported by @ericlaw1979 (Microsoft).

When an extension calls action.setTitle, setIcon, setBadgeText, setBadgeTextColor and setBadgeBackgroundColor for a specific tab, these values are automatically reset back to their default values on every navigation.

This behavior is undesirable in most cases; fixing it requires constantly calling these APIs again, and doing so results in a flicker as the icon changes from the default back to the desired icon.

This necessitates using webNavigation.onCommitted or tabs.onUpdated to re-apply the desired action icon, badge color, badge text, etc. These are high frequency events which means the background script is chronically on or loads frequently.

Proposal

Initial proposal by @wOxxOm from the same Chromium issue.

Add a parameter like persistOnNavigation. If enabled, the icon, badge text/color won't reset on navigation. This maintains background compatibility, but makes it optional.

browser.action.setBadgeBackgroundColor({
    color: "#ff0000",
    tabId,
    persistOnNavigation: true
})
@newRoland newRoland changed the title Proposal: A persistOnNavigation property for the action API (setIcon, setBadgeColor, etc) Proposal: A persistOnNavigation property for the action API (setIcon, setBadgeBackgroundColor, etc) Oct 29, 2023
@newRoland newRoland changed the title Proposal: A persistOnNavigation property for the action API (setIcon, setBadgeBackgroundColor, etc) Proposal: A persistOnNavigation property for the action API Oct 29, 2023
@xeenon xeenon added supportive: safari Supportive from Safari proposal Proposal for a change or new feature and removed needs-triage labels Oct 30, 2023
@oliverdunk oliverdunk added the follow-up: chrome Needs a response from a Chrome representative label Nov 9, 2023
@Rob--W Rob--W added the supportive: firefox Supportive from Firefox label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
follow-up: chrome Needs a response from a Chrome representative proposal Proposal for a change or new feature supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari
Projects
None yet
Development

No branches or pull requests

4 participants