I am using jQuery tab library in my Firefox extension. Tabs feature is working fine in my extension. However it is creating a zombie compartment.
这就是我如何使用标签:
$j(mydiv).find( #targetid ).tabs({selected: 2});
当我评论这条线并安装扩展名时,没有内存泄漏。知道发生了什么吗?
I am using jQuery tab library in my Firefox extension. Tabs feature is working fine in my extension. However it is creating a zombie compartment.
这就是我如何使用标签:
$j(mydiv).find( #targetid ).tabs({selected: 2});
当我评论这条线并安装扩展名时,没有内存泄漏。知道发生了什么吗?
问题在于 jQuery 界面存在于浏览器窗口中, 只要浏览器窗口保持打开, 就会保持“ 流动 ” 。 然而, 标签在内容标签中, 一旦您关闭标签, 标签就会消失。 jQuery 界面必须保存标签在某个地方的本地引用, 而引用不会让标签在标签关闭后收集垃圾( 僵尸隔间 ) 。 一种解决办法是找到该引用并删除它。 但是即使你这样解决它( 我无法做到, 因为不知道 jQuery ), 问题可能会在稍后出现, 因为 jQuery 界面是设计在一个网页上运行的, 这种记忆泄漏会被考虑进去 。
更稳健的解决方案是运行 jQuery 界面, 与它负责的 UI 相同。 这样, 您关闭 JQuery 界面及其部件的标签时, 将会被处理 - 不再有僵尸隔间 。 您可以使用 < a href=" https:// developmenter.mozilla. org/ en/ The_ messesage_manager" rel=“ nofollow” >Message 管理器 a> 来完成 :
// Load content script into the current tab
var contentScriptURL = "chrome://.../content/contentScript.js";
gBrowser.selectedBrowser.messageManager.loadFrameScript(contentScriptURL, false);
contentScript.js
然后使用mozIJSSubSpript Loader ,将jQuery和jQuery UI装入上下文:
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://.../content/jquery.js");
var jQuery = jQuery.noConflict(true);
scriptLoader.loadSubScript("chrome://.../content/jquery-ui.js", jQuery);
...
$j(mydiv).find( #targetid ).tabs({selected: 2});
此内容脚本拥有与您上铺操作的脚本相同的铬特权, 但一旦标签关闭, 将会卸载它, 并加上任何引用, 它可能会保存到标签的内容 。
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.
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 ...
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 ...
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 ...
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 ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
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.