safari - Automatic Reload on Install -


When a script is injected into a Safari extension, then this page runs on load, this means that when an injection Javascript installed will only apply to newly opened pages or pages that are reloaded later. Does anyone know how to make sure JavaScript is run without reloading?

Alternatively, the users are forced to load ... it seems a bit dangerous though.

I also tried to find a method to attach a script to "execute" or "install" is. Without reloading the page, it is possible in Chrome and Firefox. Unfortunately in Safari, I have not found any way to do this without reloading this page and taking care of injection of scripts to normal addContentScript handlers.

To reload all the Safari tabs after the extension:

reloads all tabs in
  / * glabal.js * / // Function reload Does TABs () {var browser: Windows = safari.application.browserWindows; (Var i = 0; i & lt; browser window height; i ++) {var tab = browser window [i] .tabs; For (var j = 0; j & lt; tabs.length; j ++) {tab [j] .url = tabs [j] .url; }}} Install on the first running function on {} {reloadTabs (); } Var firstRun = local storage ['extensionshose go ahead]] === undefined || ! JSON.parse (localStorage ['extensionHasPreviouslyRun']); If (formerly) {onInstall (); LocalStorage ['Extension Host Exists'] = JSON. String (true); }  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -