forked from ThomazPom/Moz-Ext-Ignore-X-Frame-Options
-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
28 lines (25 loc) · 1.03 KB
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var defaultRgx = ["http://*/*", "https://*/*"].join('\n')
var defaultRgx_fancestor = ["http://*","http://*:*", "https://*","https://*:*", "file://*"].join('\n')
var myPort = browser.runtime.connect({name:"port-from-cs"});
browser.storage.local.get("regstr_fancestor", function(res) {
var regstr_fancestor = (res.regstr_fancestor || defaultRgx_fancestor);
document.querySelector(".listextarea_fancestor").value=regstr_fancestor;
});
browser.storage.local.get("regstr", function(res) {
var regstr = (res.regstr || defaultRgx);
document.querySelector(".listextarea").value=regstr;
});
window.onload= function()
{
txarea = document.querySelector(".listextarea");
txarea_fancestor = document.querySelector(".listextarea_fancestor");
txarea.onkeyup = txarea.onchange = txarea_fancestor.onkeyup = txarea_fancestor.onchange
= function(){
regstr = txarea.value.trim()
regstr_fancestor = txarea_fancestor.value.trim()
myPort.postMessage({
updateRegexpes: regstr,
updateRegexpes_fancestor:regstr_fancestor
});
}
}