天道酬勤,学无止境

firefox-addon

How to edit or remove cookies in Firefox DevTools?

In Firebug I am able to remove and edit any cookies using the Cookies panel. But in the Firefox DevTools I can't find any way to remove or edit cookies. Where can I do that?

2021-11-29 03:18:26    分类:问答    cookies   firefox-addon   firefox-developer-tools

Firefox Extension - Multiple XMLHttpRequest calls per page

I am trying to create a Firefox extension that can run multiple XMLHttpRequests per page. The code is below (my main function calls the makeRequest on different URLs). My problem is that it always returns (at the "alert('Found ...')" for debugging purposes) the same URL instead of displaying the different responses. I think the issue is that I should somehow pass the http_request instance to the alertContents() function instead of just using http_request directly, but not sure how or if this is correct. Thank you. function makeRequest(url,parameters) { http_request = false; http_request = new

2021-11-29 02:56:20    分类:问答    javascript   ajax   firefox-addon

Create mozilla extension to display a popup and iframe in it

Am trying to develop a mozilla extension. I just need to display an iframe in a popup, but don't know how to do this. My requirement is Add a extension button on top Navigation Tool bar Display an iframe on a popup while clicking on the extension button. I didn't find any tutorial similar to this. Please help me. Thank you... Hariprasad

2021-11-29 01:35:07    分类:问答    firefox   firefox-addon   firefox-addon-sdk

How to overwrite built in XPCOM component in Firefox addon?

I'm taking a foray into Firefox extension development for the first time, and so far it's been pretty comfortable going, but I'm running into a problem; one of the things I need to do overwriting the built-in nsIPromptService and replacing it with something of my own instead. I walked through the basic XPCOM component creation tutorial here and got the hello world one working: https://developer.mozilla.org/en/creating_xpcom_components And everything in that seems to work fine, but nothing I've been able to find or research shows how I can overwrite an interface from javascript. I've seen

2021-11-29 01:09:44    分类:问答    javascript   firefox   firefox-addon   xpcom

Find URL of current tab. Making a FireFox Browser add-on

I'm making a Firefox Browser Add-on and need to find the url of the current tab I've tried this post Opening a URL in current tab/window from a Firefox Extension but it tells me that 'window' is not defined. (I think because I am making an add-on rather than an extension.) Here's what I've tried to do: var widgets = require('widget'); var tabs = require('tabs'); var widget1 = widgets.Widget({ id: "widget1", label: "widget1", contentURL: "http://www.mozilla.org/favicon", onClick: function() { console.log(tabs.url); } }) I've made a widget such that when I click it the url of the current tab

2021-11-28 15:37:42    分类:问答    firefox   firefox-addon   firefox-addon-sdk

在不使用绑定的情况下将“this”和参数传递给 addEventListener 函数(Passing 'this' and argument to addEventListener function without using bind)

问题 在禁用插件时引导插件中的 removeEventListener 不起作用之后,我正在探索其他可能性。 除了使用bind()和缓存绑定函数之外,还有没有办法使用“this”并传递参数? // works fine but can't pass argeement contextMenu.addEventListener('popupshowing', this.contextPopupShowing, false); // passes the argument but 'this' is no longer available contextMenu.addEventListener('popupshowing', function(){this.contextPopupShowing(window);}, false); 我一直在使用许多带有bind()的事件侦听器,我正在寻找不使用bind()替代方法 我什至尝试从<menupopup id="contentAreaContextMenu" ...>使用递归函数抓取window 更新: bind()干扰removeEventListener 回答1 由于我们在谈论无重启附加组件...许多无重启附加组件使用unload和unloadWindow辅助函数

2021-11-28 12:03:44    分类:技术分享    javascript   firefox   firefox-addon   firefox-addon-restartless

从 Google Chrome 扩展程序读取环境变量(Read environment variable from Google Chrome extension)

问题 是否可以从Google Chrome 扩展程序的代码(即 background.js)中读取环境变量? 这在Mozilla Firefox 扩展的情况下是可能的,这样: var system = require("sdk/system"); console.log(system.env.PATH); Chrome 的等效代码是什么? 操作系统是 Windows。 回答1 如果您想与操作系统交互,您必须创建 Windows 可执行文件并使用 Native Messaging 与之通信。 看一个例子。

2021-11-28 05:35:15    分类:技术分享    javascript   windows   google-chrome-extension   firefox-addon   environment-variables

在 Firefox 的历史记录和书签中获取访问计数的扩展组件?(extension components to get visit count in firefox's history and bookmarks?)

问题 我想知道可以使用哪个界面来获取firefox bookmarks和history中每个link的访问次数以开发扩展 我尝试使用nav-history-service来获取书签和历史记录的链接,但不知道如何查看访问计数。 回答1 此处的代码将遍历前 10 个书签整体。 如果它是一个 url,它会检查它的.accessCount属性,该属性保存它被访问的次数。 var hs = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); var query = hs.getNewQuery(); var options = hs.getNewQueryOptions(); // Query users bookmarks, not history options.queryType = options.QUERY_TYPE_BOOKMARKS; // Execute the search and store results var result = hs.executeQuery(query, options); // Open the root containerNode and open it var resultContainerNode = result

2021-11-28 03:21:14    分类:技术分享    javascript   firefox   firefox-addon   xpcom   gecko

使用 Selenium IDE Firefox 插件的截图(Screenshots using Selenium IDE Firefox plugin)

问题 使用 Selenium IDE Firefox 插件,我想自动截图。 测试脚本包含两行: Command: open; Target: http://www.google.com Command: captureEntirePageScreenshotAndWait 日志显示: [info] Executing: |open | http://www.google.com | | [info] Executing: |captureEntirePageScreenshotAndWait | | | [error] Unexpected Exception: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 3045" data: no]

2021-11-28 02:46:28    分类:技术分享    selenium   firefox-addon   screenshot

尝试从 Firefox 插件 (SDK) 中的资源加载内容时出现安全错误(Security Error when trying to load content from resource in a Firefox Addon (SDK))

问题 我正在使用 SDK 创建一个 Firefox 插件。 我的目标很简单,拦截特定的 iframe 并加载我自己的 HTML 页面(与我的插件一起打包为资源)而不是最初请求的内容。 到目前为止,我有以下代码: var httpRequestObserver = { observe: function(subject, topic, data) { var httpChannel, requestURL; if (topic == "http-on-modify-request") { httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); requestURL = httpChannel.URI.spec; var newRequestURL, i; if (/someurl/.test(requestURL)) { var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); httpChannel.redirectTo(ioService.newURI(self.data.url('pages/test.html'), undefined, undefined)); } return; } } }; var

2021-11-28 01:59:13    分类:技术分享    firefox-addon   firefox-addon-sdk