User:Asqueella/JEP 107: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 2: Line 2:


== Page Mods ==
== Page Mods ==
There are two common ways to modify web pages from the browser:
* by specifying custom CSS to apply to specific pages, sites, or all web content. (This is what [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish extension] does.)
* by letting specified scripts run modify the web page (see [https://addons.mozilla.org/en-US/firefox/addon/748 Greasemonkey extension])


==== Page Mods <i>Initialization</i> ====
The CSS-only approach is less powerful, yet often simpler and allows to dynamically apply and cancel custom style modifications to the page.
 
The JavaScript-based approach allows virtually any changes to the page to be implemented, but requires special (and non-trivial) effort to implement instant application and undoing of these modifications.
 
'''ISSUE''': Therefore, it might make sense to provide separate APIs for these two types of modifications. We'll call them "Script mods" and "Style mods" below.
 
==== Script Mods ====
<pre class="brush:js;">
<pre class="brush:js;">
var ScriptMod = require("script-mod").ScriptMod;
var ScriptMod = require("script-mod").ScriptMod;
Confirmed users
161

edits

Navigation menu