Skip to content

feat: Added ability to show on-page dialog [#1393]

This MR is based on #1385 (closed) and contains the following changes:

  • Added unrelated type definitions:
    • browser.d.ts
      • Adjusted js/api code accordingly.
    • webext-sdk.d.ts
    • webpack.d.ts
      • Added support for new module file types.
      • Added support for webpack-generated "info" module.
    • Added temporary type definitions to src/polyfills, while the respective code hasn't been converted to TypeScript.
  • Added preferences for testing:
    • onpage_timings
  • Extended TabSessionStorage to listen to when relevant data gets removed due to a tab being unloaded.
  • Implemented on-page dialog.
    • Added tab manager module to map commands to tabs and to handle communication from/to content scripts.
      • Added timing module to execute timing parameters defined in timing configuration.
    • Added frame manager to create/update/remove frames inside web pages.
    • Added on-page dialog UI page.
      • Updated $ lint.css to include CSS files from src/ directory.
    • Added content script bundles:
      • Polyfills
      • Frame manager (injected into all top-level frames)
      • Dialog (injected into all frames)
        Only becomes active in anonymous sub-frames after it receives "onpage.start" message event and a subsequent response to "onpage.get", so that it doesn't render the dialog prematurely.
    • Added content styles:
      • Frame manager (injected on-demand)
      • Dialog (bundled with content script)
    • Bundle dialog assets into dialog content script to avoid web-accessible resources:
      • Dialog HTML content
      • Dialog styles
      • Logo
      • Close icon
        Duplicated and trimmed because it wasn't possible to use URL fragments with data URIs.
      • Fonts
      • Font styles
        _Duplicated because we need to bundle font files. _
  • Added helper features:
    • logger: Provides logging functionality.
  • Updated build scripts accordingly.
    • Added support for importing CSS and HTML files via webpack as text.
    • Added support for importing SVG and WOFF2 files via webpack as data URIs.
  • Disabled any seemingly unnecessary ESLint rules, that may change when we start using Standard after rebasing the changes.

Note that these changes have also been reviewed internally during development at https://gitlab.com/adblockinc/ext/adblockplus/private/adblockplusui/-/merge_requests/2.

Edited by Thomas Greiner

Merge request reports