2012-10-05 48 views
0

我開發了一個簡單的JavaScript注入,效果很好。 任何人都可以告訴我如何定義我想讓我的Firefox加載項工作的域?Firefox附加組件:域名聲明

E.g.這不適合www.myexample.com在main.js工作:

const self = require("self"), 
page_mod = require("page-mod"); 

exports.main = function() { 
    page_mod.PageMod({ 
     include: "*myexample.com*", 
     contentScriptWhen: "ready", 
     contentScriptFile: self.data.url("inject.js") 
    }); 
}; 

這些線路也不起作用:

include: "*.myexample.com/*", 
include: "*.myexample.com*", 

回答

1

這一切都在documentation

include: "*.example.com", 

match-pattern模塊可以識別您打算只匹配域名的時間,不需要在域名後添加通配符。

+0

謝謝!我查閱了文檔,但沒有搜索選項。所以我沒有找到該頁面。 –