admin管理员组文章数量:1290191
To execute bookmarklet code the bookmarklet needs to be actioned by the user. Is there any way to have a bookmarklet or indeed any javascript run automatically on page load?
Or is an Add-on the way to go?
Thanks
To execute bookmarklet code the bookmarklet needs to be actioned by the user. Is there any way to have a bookmarklet or indeed any javascript run automatically on page load?
Or is an Add-on the way to go?
Thanks
Share Improve this question asked Jan 25, 2010 at 10:14 Richard HRichard H 39.1k38 gold badges114 silver badges141 bronze badges5 Answers
Reset to default 5I don't think that it is possible to autorun a bookmarklet on pageload. This could be used very maliciously.
I think a plugin is the best way to go here. If only for personal use, you should check out greasemonkey for Firefox.
GreaseMonkey
Greasemonkey, or Tampermonkey on Chrome allow this.... but they need the script you want to run
for example, if a certain site always puts up some type of an ad overlay and you can find or write a script to kill that, you can enter that source into Tampermonkey and it will run on each page load globally or at whatever site / domain/ wildcard expression you designate
alternatively if you are looking to block certain scripts and want to automate the process, Notscript for chrome will show you each script that ran when you visited a site and allow you to designate which you want to allow on subsequent visits at that site or all sites, very very cool... that way you need not write or find a script to block behaviors you don't like
as previously pointed out, when you do this stuff you are seriously screwing with browser security, so be careful and just don't set up any old script unless you can read them or trust the source....
I think Opera allows you to auto inject js into a library of sites you specificy 'onload' regardless of ownership.
Well, any javascript runs automatically using onload event, if thats what you need?
本文标签: Is there any way to have some javascript (such as a Bookmarklet) autorun on page loadStack Overflow
版权声明:本文标题:Is there any way to have some javascript (such as a Bookmarklet) autorun on page load? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741492402a2381682.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论