Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Latest commit

 

History

History
47 lines (34 loc) · 2.03 KB

developer_notes.md

File metadata and controls

47 lines (34 loc) · 2.03 KB

Developer Notes

These may or may not be out of date.

General Notes

  • cosmetic-filtering.js > FilterContainer.prototype.compileGenericHideSelector checks whether a hostname is required for the filter. If we want to keep slow filters, we cannot change this check, as assumption of code after will no longer be valid, and things will break.

  • redirect-engine.js > suffersSpuriousRedirectConflicts attempts to unbreak HTTPS Everywhere. We usually do not like this kind of tradeoff, but considering websites that are not using HTTPS are unlikely to use CSP, this seems to be a reasonable tradeoff.

  • redirect-engine.js > RedirectEngine.prototype.compileRuleFromStaticFilter accepts first-party and 1p, but not ~third-party nor ~3p.

  • scriptlet-filtering.js > api.compile will convert script snippet rules with negated domains to exception rules. If the domains do not match, it can cause unintended behavior.

  • static-ext-filtering.js > api.compile sometimes passes double-hash filters with no suffix onwards to static network filtering engine. localhost## will cause an error to be logged to the background console from static-net-filtering.js > FilterParser.prototype.parse. localhost#?# and localhost#^# are compiled to static network filters.

  • storage.js > µBlock.compileFilters checks whether the filter starts with # and discards the filter if it does. This is safe because double-hash filters are already handled.

Other Observations

  • 1p-filters.js does not check for unsaved changes when save is initiated via shortcut key, and will always perform a save even if there were no changes.

  • static-net-filtering.js > FilterContainer.prototype.compile checks for empty lines, but there seems to be no way for empty lines to enter this function.

  • storage.js > µBlock.loadRedirectResources checks whether results is an array, but it is guaranteed to be an array as it comes from Promise.all.

  • storage.js > µBlock.compileFilters > reLocalIp has a group but is never used.