When using paths, platform implementations of setIcon typically
will fetch the resource then convert to image data internally.
It is preferable for uBO to do this conversion itself as it can
be done only once at launch time.
With chromium-based browsers, using image data eliminate the
incessant network traffic to fetch browser icons as reported
in the extension's dev tool, meaning a good chunk of overhead
is eliminated.
Also, use optimal icon sizes, as of now both chromium and firefox
prefers 16px instead of 19px, and 32px instead of 38px.
Upon start-up, uBlock runs all content scripts in manifest.json using
`chrome.tabs.executeScript`. When this API is used, the value of the
last expression is automatically cloned and transferred to the
callback of `chrome.tabs.executeScript`. This is convenient if needed,
and a performance burden otherwise (the latter is the case for uBlock).
There are three content scripts that need to be checked:
- vapi.js
The last expression is often the vAPI object, and it is relatively
expensive to clone this object. This commit sets the value of the
last expression to `void 0` to solve this inefficiency.
- vapi-client.js
No action needed yet; The last expression is `vAPI.shutdown.add(...)`,
which has a void return value.
- contentscript.js
No action needed yet; The last expression is an immediately-invoked
function expression without return value.
* Fix leftovers from old code.
* change changes.procedural.size to changes.procedural.length
changes.procedural is an array so it should be changes.procedural.length
the code works with changes.procedural.size because (undefined !== 0) is always true.
commit ab2b328cf1360a751fa1c58b8521f907eeb1ec50
Author: Raymond Hill <rhill@raymondhill.net>
Date: Thu Apr 12 12:08:30 2018 -0400
fix#3588
commit c4ae7638dfa5a5c7ddec2f9dd2d2988450082542
Author: Raymond Hill <rhill@raymondhill.net>
Date: Thu Apr 12 09:08:56 2018 -0400
detect user stylesheets support from content scripts (#3588)