userChrome.xml 991 B

1234567891011121314151617181920212223242526
  1. <?xml version="1.0"?>
  2. <!-- Copyright (c) 2017 Haggai Nuchi
  3. Available for use under the MIT License:
  4. https://opensource.org/licenses/MIT
  5. -->
  6. <bindings id="generalBindings"
  7. xmlns="http://www.mozilla.org/xbl"
  8. xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9. xmlns:xbl="http://www.mozilla.org/xbl">
  10. <binding id="js" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged">
  11. <implementation>
  12. <constructor><![CDATA[
  13. function makeRelativePathURI(name) {
  14. let absolutePath = Components.stack.filename;
  15. return absolutePath.substring(0, absolutePath.lastIndexOf("/") + 1) + name;
  16. }
  17. // The following code executes in the browser context,
  18. // i.e. chrome://browser/content/browser.xul
  19. Services.scriptloader.loadSubScript(makeRelativePathURI("userChrome.js"), window);
  20. ]]></constructor>
  21. </implementation>
  22. </binding>
  23. </bindings>