OctoLinker
OctoLinker copied to clipboard
dismiss the news panel on one tab should close it everywhere
Expected Behavior
I have a lot of github tabs open any time. when octolinker gets a new update which displays a news message, this message is visible on all the tabs. I have to dismiss it at least 10 times
What actually happened?
dismiss the news on any tab, should make it disappear on all openend tabs
URL
No response
Anything else we should know?
I guess this should be possible with the post-message api
@stefanbuck GitHub used to do something where if you weren't logged in and had multiple tabs open when you logged in the others would give you a banner saying you logged in and a button to reload the page. I'm pretty sure they used local storage and listened for a value to be set to show that banner. Not sure if this is applicable here, but it might be one way to achieve this.
There is another option which is what I have used in Jumpcat to address a similar problem. The web-ext API allows us to send message to all tabs and such a message could dismiss the update dialog in all other tabs.
function broadcastMessageToAllTabs(eventType) {
chrome.tabs.query({}, (tabs) => {
tabs.forEach(tab => {
chrome.tabs.sendMessage(tab.id, 'some-message');
})
});
}