简体   繁体   中英

injected script in safari extension vs. global variables

All scpripts injected by Safari extension run in their own namespace. Is it possible to access original (website author's) javascript variables/functions from injected script?

Safari extensions (global.html) are working like little Webpages around your pages. except from the "proxy" declarations to share data, functions, handlers with the injected scripts it should be possible to connect to other webcontent somewhere. i've testet a xml-httprequest from inside a global.html (ajax), did work like a charme.

but if you mean to call javascript functions from your injected script but given from your content (website author's pages), make shure you call them after they are ready loaded. everything you can call from the main (webkit) console is possible to call from a script too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM