Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As of Add-on SDK 1.14 there's experimental (API may change) support for this in the <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/1.14/modules/sdk/page-mod.html" rel="nofollow">page-mod</a> module:</p> <pre><code>var pageMod = require("sdk/page-mod").PageMod({ include: "*", contentStyleFile: require("sdk/self").data.url("my-style.css") }); </code></pre> <p>See <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/1.14/dev-guide/tutorials/modifying-web-pages-url.html" rel="nofollow">Modifying Web Pages Based on URL</a> for an elaborate guide to using page-mod.</p> <p>There's <a href="https://github.com/mozilla/addon-sdk/wiki/contentStyle-issues" rel="nofollow">a page on the Addon SDK's wiki</a> discussing issues with the current implementation, although it seems a bit outdated.</p> <p>Under the hood it uses <a href="http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl" rel="nofollow">nsIDOMWindowUtils</a>.loadSheet() to add the stylesheet without touching the page's DOM. (This API was added in Firefox 18, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=737003" rel="nofollow">bug 737003</a>. Before that you had to use <a href="https://developer.mozilla.org/en/Using_the_Stylesheet_Service" rel="nofollow">nsIStyleSheetService</a> which was similar, but not tab-specific.)</p> <hr> <p>Before that you could use the page-mod's content script to insert the link or style element (<a href="https://forums.mozilla.org/addons/viewtopic.php?p=13101#p13116" rel="nofollow">example</a>). [edit] thanks to lwburk's comment, here's a more elaborate elaborate description in <a href="http://books.google.ru/books?id=KWRE2C_S4YsC&amp;pg=PA19&amp;lpg=PA19&amp;dq=mark+pilgrim+add+Global+Style&amp;source=bl&amp;ots=SnfX5Ad2WO&amp;sig=CKoF9A0Ala96vphTeU4mK2dbMe4&amp;hl=en&amp;ei=GJ3iTpeJKKK2sQLBkMDvBQ&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;redir_esc=y#v=onepage&amp;q&amp;f=false" rel="nofollow">Greasemonkey Hacks: Tips &amp; Tools for Remixing the Web with Firefox By Mark Pilgrim: "Alter a Page's Style" section</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload