Tag: firefox webextensions

TypeError:内容脚本中未定义或为什么我不能在内容脚本中执行此操作?

我试图在Firefox中编写一个简单的扩展,其中我修改了X-Frame-Allow头。 我简要地查看了文档,发现它们支持webRequest.onHeadersReceived.addListener() 。 但是,我无法让我的代码在收到标题时运行。 的manifest.json { "manifest_version": 2, "name": "xframeoptions", "version": "1.0", "description": "Set X-Frame-Options to ALLOW", "icons": { "48": "icons/icon.png" }, "permissions": [ "webRequest", "webRequestBlocking", "<all_urls>" ], "content_scripts": [ { "matches": ["<all_urls>"], "js": ["xframeoptions.js"] } ] } xframeoptions.js function rewriteHeader(e) { console.log(e.responseHeaders); for (var header of e.responseHeaders) { console.log(header.name + ":" + header.value); if […]

完全失去了如何保存扩展popup窗口的内容

我几乎失去了如何使我的popup窗口的添加内容不会消失,每次我打开一个新的链接或点击它“离开”。 我已经阅读了关于内容脚本,后台脚本之类的东西,但是我不老实地知道如何将其实现到我自己的源代码中。 以下是我的popup.html , popup.js和我的manifest.js文件。 { "manifest_version": 2, "name": "URL_save", "description": "This extension saves an URL and renames the title to the user's wishes and hyperlink the title.", "version": "0.1", "browser_action": { "default_icon": "/img/icon.png", "default_popup": "popup.html", "default_title": "See your saved websites!" }, "permissions": [ "tabs" ] } popup的HTML : <html> <head> <title>Your articles</title> <link href="/css/style.css" […]

Firefox扩展.xpi文件结构:描述,内容,创build和安装

我花了很多东西来search一个简单的方法来开发一个Firefox扩展,但我无法创build一个扩展。 请告诉我Firefox扩展的文件结构和安装扩展的简单方法。

Google Chrome / Firefox在控制台中看不到扩展名输出

我正在尝试为浏览器testingWeb扩展的示例代码。 但是,这是行不通的。 我检查了Google Chrome和Firefox的控制台。 它不打印任何东西。 以下是我的代码: manifest.json : { "description": "Demonstrating webRequests", "manifest_version": 2, "name": "webRequest-demo", "version": "1.0", "permissions": [ "webRequest" ], "background": { "scripts": ["background.js"] } } background.js : function logURL(requestDetails) { console.log("Loading: " + requestDetails.url); } chrome.webRequest.onBeforeRequest.addListener( logURL, {urls: ["<all_urls>"]} ); console.log("Hell o extension background script executed"); 我错过了什么吗?