javascript - Improving the Bookmarklet Experience - Though Hacking? -


so have site specific bookmarklet create page toolbar (using localstorage set/get variables) , creates iframe destination site, www.example.com. [idea heavily borrowed wonderful rwd bookmarklet (http://responsive.victorcoulon.fr/) ]. works great, wanted provide clickable link bookmarklet (because pain add bookmarklet in ipad) unfortunately results in obvious xss cross-site problems since link not reside within www.example.com.

to improve experience wondering if possible have popup (like twitter's) exploit existing generic loadscript function present on www.example.com. within javascript console on www.example.com can invoke supervar.loadscript("http://dl.dropboxusercontent.com/s/blah/thefile.js") , works. means not need append or cross load js iframe need iframe invoke supervar.loadscript call.

it possible invoke supervar.loadscript on window.onload/document.ready type scenario or context of popup code pointing about:blank/notexample.com in case supervar not exist. window.postmessage of use?

update: clarification

i trying have button contain javascript code in turn open new window/tab site able invoke command on variable present when dom ready. again, i'm quite new xss i'm not sure if security problem on site. i'm not trying access variables 1 site next, means load userscript on site without having use bookmarklet.

for real test:

visit: firsttaste.kraftcanada.com. open javascript console , enter: nitrowidget.loadscript("https://dl.dropboxusercontent.com/s/fcfbpfdmzrxywh9/mwolfe_alert.js") execute mwolfe_alert.js merely contains alert message.

is there way create clickable link on site outside of *.kraftcanada.com create popup/new tab upon {document,window,$}.onload/read invoke nitrowidget.loadscript?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -