Safari Extensions: event for changing tabs?

Possible duplicate:
Safari 5 extension: how do I know when the current window tab has changed?

I am trying to open a popup in Safari which is tab dependent and is triggered by a button (which can noticeably switch). How can I make sure that when switching the tab, the button will be switched correctly, i.e. Illuminated if a popup is visible; not otherwise.

I looked around to listen, but it did not work and did not focus.

Any ideas?

Greetings.

+3
source share
1 answer

, API , , .

, javascript , .

, , postMessage.

injected.js:

window.addEventListener( "load", load, false);

safari.self.tab.dispatchMessage( "somethinghappened", "" );

0

Source: https://habr.com/ru/post/1756747/


All Articles