Skip to content
Snippets Groups Projects
Commit 356325d4 authored by didierfred's avatar didierfred
Browse files

create a menu

parent 16c58bf8
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
"browser_action": {
"default_icon": "icons/modify-32.png",
"default_title": "Simple Modify Headers",
"default_popup": "popup/config.html"
"default_popup": "popup/menu.html"
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="button" id="start_stop" value="Start" ></input>
<input type="button" id="config" value="Configure"></input>
</center>
<script type="text/javascript" src="menu.js"> </script>
</body>
</html>
/* 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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment