Newer
Older
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* @author didierfred@gmail.com
* @version 0.1
*/
var started = "off";
window.onload = function() {
document.getElementById('config').addEventListener('click',function (e) {start_config();});
document.getElementById('start_stop').addEventListener('click',function (e) {start_modify();});
started = localStorage.getItem("started");
if (started=="on") document.getElementById("start_stop").value = "Stop";
} ;
function start_modify()
{
if (started=="off")
{
localStorage.setItem("started","on");
browser.runtime.sendMessage("on");
started = "on";
document.getElementById("start_stop").value = "Stop";
}
else
{
localStorage.setItem("started","off");
browser.runtime.sendMessage("off");
started = "off";
document.getElementById("start_stop").value = "Start";
}
}
function start_config()
{
var strWindowFeatures = "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=800,height=600";
window.open("config.html","Simple Modify Headers",strWindowFeatures);
}