English 中文(简体)
• 如何在一页上注射酒类法,严格说是客户, Chrome?
原标题:How to inject jQuery code on a page, strictly client side - Chrome?

我不禁要问, Chrome一是否有办法,能否在一页的Im望上执行一个js档案? 换言之,我能够访问一些我没有控制权的网站(例如, st流)。

$( body ).fadeOut( slow );

I could just type it in the console, and that works, but let s say there s a whole bunch of jQuery code I wanted to run and test out. Is there some way I can do this?

最佳回答

http://www.howtogeek.com/howto/24790/beginner-guide-for-greasemonkey-scripts-in-google-chrome/“Greasemonkey。

问题回答

肯定的是,只读出一幅新文字:

var myScript = document.createElement( script ); 

myScript.type =  text/javascript ; 
myScript.async = true;
myScript.src =  http://path/to/your/js/file.js  // ie: jquery hosted on google cdn

var s = document.getElementsByTagName( script )[0]; 

s.parentNode.insertBefore(myScript, s);

与其他js案的复读。

值得注意的是,这仍在使用独角大楼,但将允许你至少装满一个档案库,而不是仅仅打打上你的代码,在浏览器中执行。

Regarding this I found painless solution. I installed jQuerify. It injects jQuery (the latest available stable version) even into HTTPS pages with one click with no conflict to Prototype )))

我同意 gr子的回答。 但另一种选择是一本小册子:

http://en.wikipedia.org/wiki/Bookmarklet

并且为了迅速和 d忙,你只能将你书记本直接复制到您的地址吧(在你完成书记本之前进行测试)。

I think you might be looking for a chrome plugin. I looked in the webstore, but there doesn t appear to be one to execute arbitrary code. Since we have no idea what your end goal is we really can t point you to anything more specific that write the code in your editor of choice and copy/paste it into the console.





相关问题
Redirect to cache URL in Chrome browser

self.location = cache: + self.location I want to redirect from "[URL]" to "cache:[URL]". I just want this code to work in Chrome browser.

我如何更新/重载 Chrome延?

I m在4号 Chrome(目前为4.0.249.0)中开发一个延伸点,显示用户在地位酒吧中的形象。 Ive设计了一个供用户使用的备选办法网页......

Setting Opacity in CSS For Chrome

I ve tried the following: (this is actually for fancybox, as the overlay does not show in chrome/safari: $("#fancy_overlay").css({<br /> background-color : opts....

Chrome Blocking Javascript, Google Wave, Google Gadgets

Project: Developing a gadget template for Google Wave which will allow my Flash movies to interact with the Wave api. I had to adapt the existing Flex application so that it would work with ...

image height using jquery in chrome problem

$( img ).height() returns 0 in chrome, but it returns the actual height in IE and firefox. Whats the actual method to get the height of the image in chrome?

jQuery block moving

I wanna move a div block to the top, so I coded like this: CSS part: .movingPart{ margin-top:80px; } jQuery part: $(document).ready(function() { $( #btn ).click(function() { $( .movingPart )....

Table cells bad rendering with Google Chrome/Webkit

On the following code, COL1A and COL3A are not 50% height with Chrome or Webkit. It works fine with IE7 and Firefox. <table border="1"> <tr> <td height="100%">COL 1A</td>...

热门标签