Commit 9e7b00a0 authored by peachaku's avatar peachaku
Browse files

firefox webextension

parent 16105286
content custombutton chrome/
style chrome://global/content/customizeToolbar.xul chrome://custombutton/content/button.css
# Firefox
overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul
\ No newline at end of file
#mybutton
{list-style-image: url("chrome://custombutton/content/button.png");}
\ No newline at end of file
transformUrl = {
1: function () {
var l=gBrowser.currentURI.spec;
gBrowser.loadURI(l.replace(l,'ezproxy.univ-abc.fr/login?url='+l));
},
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css"
href="chrome://custombutton/content/button.css"?>
<!DOCTYPE overlay >
<overlay id="custombutton-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://custombutton/content/button.js"/>
<script type="application/javascript"
src="chrome://custombutton/content/init.js"/>
<!-- Firefox -->
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mybutton"/>
</toolbarpalette>
<!-- button details -->
<toolbarbutton id="mybutton"
label="lama"
tooltiptext="Accès hors campus"
oncommand="transformUrl[1]()"
class="toolbarbutton-1 chromeclass-toolbar-additional custombutton"
/>
</overlay>
\ No newline at end of file
window.addEventListener("load", em_myextensionLoad, true);
function em_myextensionLoad() {
if (document.getElementById("mybutton")) return;
try {
var firefoxnav = document.getElementById("nav-bar");
var curSet = firefoxnav.currentSet;
if (curSet.indexOf("mybutton") == -1)
{
var set;
if (curSet.indexOf("urlbar-container") != -1)
set = firefoxnav.currentSet + ",mybutton";
else
set = curSet.replace(/urlbar-container/, "mybutton,urlbar-container");
firefoxnav.setAttribute("currentset", set);
firefoxnav.currentSet = set;
document.persist("nav-bar", "currentset");
try {
BrowserToolboxCustomizeDone(true);
}
catch (e) { }
}
}
catch(e) { }
}
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description
about="urn:mozilla:install-manifest"
em:name="lama"
em:description="Accès hors campus aux ressources électroniques documentaires de l'Université d'Aix-Marseille"
em:creator="Laurent Lhuillier"
em:id="lama@univ-amu.fr"
em:version="0.2.1"
em:homepageURL=""
em:iconURL="chrome://custombutton/content/icon.png" >
<em:targetApplication><!-- Firefox -->
<Description
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="4.0.*"
em:maxVersion="45.*" />
</em:targetApplication>
<em:type>2</em:type>
</Description>
</RDF>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment