English 中文(简体)
Inject Dynamic script in extension
原标题:Inject dynamic script in Firefox extension

我现在做的是延期,我有一部分文字是静态的(永远不会改变),另一部分则从网站装上。 并且,看到两种方式:

  1. To load it with XMLHttpRequest and inject into web page
  2. To put it as a <script src="example.com/myscript.js"></script> and have it load it itself

但是,第二种方式也许会赢得我对延期请求的利用(涉及延伸档案中确定的职能,即chrome://myext/script.js)。

而且,第一种方式可能不可靠,因为我不得不在<条码>上打上代码。 装载页标的

任何想法?

问题回答

Are you saying that you want the dynamic script to have chrome privileges? If so, why not load it using XMLHttpRequest, save it to disk and then import it as a JavaScript Module (https://developer.mozilla.org/en/JavaScript_code_modules/Using). Obviously there are security considerations since you are giving a script from the web pretty much unlimited privileged, but if you control the script s source then you are presumably okay. If you are really worried you can use HTTPS to download the script, which will protect against someone intercepting the traffic.

如果你希望该守则具有内容特权,但可以查阅你在《 Java》中的职能,那么你可能想将神学院的职能置于本条所描述的内容之下:rel=“nofollow”http://weblogs.mozine.org/weirdal/archives/017188.html。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签