Issue #972 - Integrated EWE ad blocking SDK
This MR contains the following changes:
- Removed adblockpluscore dependency.
- Updated webext-sdk dependency.
- Use EWE API instead of adblockpluscore APIs.
- Removed redundant files, code and preferences.
- Applied temporary workarounds for:
- Added missing license header to lib/recommendLanguage.js.
- Fixed: EWE bundle creation fails.
- See details about changes in files below.
It does not contain the following changes, because they can be worked on in separate issues, but should be included in the release:
- ewe#135 - Requests may be counted or shown twice in issue reporter and in developer tools panel.
- ewe#139 - Sitekey-based allowlisting is broken on Firefox.
- ui#1057 - Snippet tests are skipped in webext child pipeline.
- ui#1058 - Issue reporter doesn't include optional browser information.
- Update vendor/webext-sdk submodule URL.
- Remove EWE's source maps.
- Remove redundant "subscriptions.get" message arguments from mobile options page and from adblockpluschrome tests.
- Some adblockpluschrome tests are failing:
- Can be safely ignored:
- WebRTC
- WebSocket Exception
- subscribes to a link
- Waiting for confirmation from QA that they can be safely ignored:
- CSP Exception
- dir-string
- strip-fetch-query-parameter
- Can be safely ignored:
It does not contain the following changes, because they can be worked on in separate issues, but can be included in a subsequent release:
- ui#1002 - Remove webext child pipeline
-
ui#1050 - Rename
Filter
andSubscription
"disabled" property to "enabled" in Messaging API - remove adblockpluschrome subdirectory
Detailed changes per file
-
adblockpluschrome:
-
build/config/base.js:
- Removed redundant files
- Started using SDK bundles
- Added composer.preload.js directly, instead of indirectly via include.preload.js bundle
-
build/config/webpack.config.js:
- Removed adblockpluscore dependency
-
build/config/manifest.json:
- Started using SDK bundles
- Added composer.preload.js directly, instead of indirectly via include.preload.js bundle
- Removed redundant files
-
lib/allowlisting.js:
- API changes
- Removed
listAllowlistingFilters()
in favor ofewe.filters.getAllowingFilters()
- Stopped using Filter
- Removed
checkAllowlisted()
in favor ofewe.filters.isResourceAllowlisted()
- Changed "changed" event to return boolean instead of filter
- Moved allowlisting state initialization to subscriptionInit.js
- Removed
- Removed redundant code:
- Manage frame hierarchy
checkAllowlisted()
listAllowlistingFilters()
- Handle sitekeys
- API changes
-
lib/contentFiltering.js:
- API changes
- Removed redundant code:
- Manage page stylesheets for applying hiding filters
- Manage page scripts for applying snippet filters
- lib/csp.js: Removed redundant files: CSP-based request blocking
-
lib/devtools.js:
- API changes: Refactored
hasRecord()
function - ui#1003 - Temporary workaround: Removed code for matching and updating existing records
- API changes: Refactored
-
lib/filterComposer.js: API changes: Removed
checkAllowlisted()
in favor ofewe.filters.isResourceAllowlisted()
(see also ewe#136) -
lib/filterConfiguration.js:
- API changes
- Converted disabledFilterCounters into Map, since we no longer have access to unique Subscription objects
- Replaced "subscription.filtersDisabled" with "filtersDisabled" event
- Made
askConfirmSubscription()
work with generic objects - Use
String.trim()
instead ofFilter.normalize()
, because it's no longer exposed to us - Moved disabled filter counters initialization to subscriptionInit.js
- Fixed:
typeof null === "object"
so we have to useinstanceof
instead (see also ui#1022) - Removed redundant code:
convertSubscriptionFilters()
- Messaging API event listener abstraction
- Filter validation
- "filterState.listen" message handler
- API changes
-
lib/hitLogger.js:
- API changes: Introduced
getTarget()
function to convert filter matches into a request object, that we used to have - Removed redundant code: Hit logging
- API changes: Introduced
- lib/icon.js: API changes
- lib/io.js: Removed redundant files: Abstaction for storing filters as file
- lib/messageResponder.js: API changes
-
lib/notificationHelper.js:
- API changes
- Use ewe.notifications.*
- Moved locale initialization to
initNotifications()
- Initialize and keep ewe.notifications.numBlocked updated
- API changes
- lib/popupBlocker.js: Removed redundant files: Popup blocking
-
lib/prefs.js:
- Removed redundant prefs
- Use ewe.notifications.*
- Fixed: incorrect property name for "prefs.set" message handler
-
lib/requestBlocker.js:
- API changes: Use ewe.reporting.contentTypesMap
- Removed redundant code
- lib/stats.js: API changes
-
lib/subscriptionInit.js:
- API changes
- Determine data corruption using values returned by
ewe.start()
- Initialize and keep element hiding debug mode updated
- Determine data corruption using values returned by
- Removed redundant code
- API changes
- lib/uninstall.js: API changes
- test/browsers/chromium.js: Removed adblockpluscore dependency for end-to-end tests
- test/browsers/firefox.js: Removed adblockpluscore dependency for end-to-end tests
- test/runners/chromium_download.mjs: Removed adblockpluscore dependency for end-to-end tests (copied over module from adblockpluscore)
- test/runners/download.mjs: Removed adblockpluscore dependency for end-to-end tests (copied over module from adblockpluscore)
- test/runners/firefox_download.mjs: Removed adblockpluscore dependency for end-to-end tests (copied over module from adblockpluscore)
- test/unit-tests/prefs.js: Removed redundant preferences
- test/unit-tests/uninstall.js: API changes
- .gitignore: Removed adblockpluscore dependency for end-to-end tests
- .gitlab-ci.yml: Removed adblockpluscore dependency for end-to-end tests
- adblockpluscore: Removed adblockpluscore dependency
- composer.preload.js: ui#1031 - Temporary workaround: Reuse filter previews
- gulpfile.js: Removed adblockpluscore dependency
-
include.preload.js:
- Removed redundant files:
- Element hiding
- Element collapsing
- Extracting sitekey
- Recording hiding filter hits
- Removed redundant files:
- inject.preload.js: Removed redundant files: WebRTC blocking
- subscriptionLink.postload.js: Removed redundant files: Subscribe links
-
build/config/base.js:
- js/pages/issue-reporter/report.js: ewe#135 - Temporary workaround: Avoid counting requests multiple times
- lib/pages/options.js: API changes
- lib/notifications.js: API changes
-
lib/recommendLanguage.js:
- Added missing license header
- Removed redundant code
- vendor/webext-sdk:: Upgraded webext-sdk dependency
- .gitmodules: Removed adblockpluscore dependency
-
package.json: Fixed:
npm run dist
fails due to missing webpack dependency in adblockplusui - README.md: Removed adblockpluscore dependency
Edited by Thomas Greiner