Advertisement
difool2nice

userchrome.xml

Apr 2nd, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.85 KB | None | 0 0
  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="generalBindings"
  4.   xmlns="http://www.mozilla.org/xbl"
  5.   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  6.   xmlns:xbl="http://www.mozilla.org/xbl">
  7.  
  8.   <binding id="js" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
  9.     <implementation>
  10.         <constructor><![CDATA[
  11.            function makeRelativePathURI(name) {
  12.              let absolutePath = Components.stack.filename;
  13.              return absolutePath.substring(0, absolutePath.lastIndexOf("/") + 1) + name;
  14.            }
  15.            // The following code executes in the browser context,
  16.            // i.e. chrome://browser/content/browser.xul
  17.            Services.scriptloader.loadSubScript(makeRelativePathURI("userChrome.js"), window);
  18.        ]]></constructor>
  19.     </implementation>
  20.   </binding>
  21. </bindings>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement