Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand WebExtensions support #2114

Closed
18 of 79 tasks
aartaka opened this issue Feb 17, 2022 · 2 comments · Fixed by #3270
Closed
18 of 79 tasks

Expand WebExtensions support #2114

aartaka opened this issue Feb 17, 2022 · 2 comments · Fixed by #3270
Labels
ffi Renderer-specific quirks. high lisp-protocol nyxt/lisp URLs and internal pages.

Comments

@aartaka
Copy link
Contributor

aartaka commented Feb 17, 2022

Our current WebExtensions support is experimental, and there's not much extensions we can run with it. We need to expand it. We can start by supporting uBlock-required APIs, as this is a sane minimum for a WebExtensions support to have. Here's a (mostly copy-pasted from #1762) list of things to fix/add/think about:

  • runtime.getURL returns data: URLs which are only suitable for resource loading, while being a security hole when navigated to. We need to use the recent mechanism from Internal schemes redesign. #2049 to build and fetch web-extension:// scheme links.
  • Permissions
    • Implemented on Lisp-side.
    • Load-time ones on C-side.
    • Runtime change of permission on the C-side.
  • Add/fix event filters. Commits between 9c942da and d9648bb add an experimental implementation of it, but it's unreliable and most likely broken.
  • Commands.
  • Option pages.
  • Supporting more manifest.json keys (alphabetic order):
    • browser_action
    • content_scripts
    • description
    • homepage_url
    • icons
    • manifest_version
    • name
    • version
    • author
    • background
    • browser_specific_settings
    • chrome_settings_overrides
    • chrome_url_overrides
    • commands
    • content_security_policy
    • default_locale
    • developer
    • devtools_page
    • dictionaries
    • externally_connectable
    • incognito
    • offline_enabled
    • omnibox (set-url integration?)
    • optional_permissions
    • options_page
    • options_ui
    • page_action
    • permissions
    • protocol_handlers
    • short_name
    • sidebar_action
    • storage
    • theme (integrate with Enable color themes. #1889?)
    • theme_experiment
    • user_scripts (requires Support Greasemonkey user-scripts #2021?)
    • version_name
    • web_accessible_resources
  • Supporting uBlock-used APIs (duplicated in Adblock/Umatrix like functionality? #32, will be tracked there from now on):
    • Methods (alphabetically, with unimplemented on top):
      • browser.browserAction.setPopup -- easy
      • browser.commands.getAll -- easy
      • browser.commands.reset -- easy
      • browser.commands.update -- easy
      • browser.i18n.getMessage -- easy?
      • browser.runtime.connect
      • browser.runtime.reload
      • browser.tabs.move -- easy
      • browser.webRequest.filterResponseData
      • browser.webRequest.handlerBehaviorChanged
      • browser.runtime.getBrowserInfo
      • browser.runtime.getManifest
      • browser.runtime.getURL
      • browser.tabs.create
    • Variables and types (will be mostly easy to do):
      • browser.runtime.lastError
      • browser.windows.WINDOW_ID_NONE -- easy
      • browser.webRequest.ResourceType -- easy
    • Events (alphabetically, with unimplemented on top, hardest to do as they require modifications all over Nyxt sources):
      • browser.browserAction.onClicked -- easy
      • browser.commands.onCommand -- easy
      • browser.runtime.onConnect
      • browser.runtime.onUpdateAvailable
      • browser.tabs.onActivated
      • browser.tabs.onCreated -- easy
      • browser.tabs.onRemoved -- easy
      • browser.tabs.onUpdated
      • browser.webNavigation.onCommitted
      • browser.webNavigation.onCreatedNavigationTarget
      • browser.webRequest.onBeforeRequest
      • browser.webRequest.onHeadersReceived
      • browser.windows.onFocusChanged -- easy
    • Non-mandatory but cool APIs because uBlock uses them to provide more features:
      • browser.dns
      • browser.privacy
      • browser.menus
@aartaka aartaka added ffi Renderer-specific quirks. high lisp-protocol nyxt/lisp URLs and internal pages. labels Feb 17, 2022
@Ambrevar
Copy link
Member

In #1762 you also mentioned:

Memory is not freed everywhere it needs to be. This can clutter our memory with time. Thus, C-side of things asks for more memory discipline.

Is this still valid?

@aartaka
Copy link
Contributor Author

aartaka commented Feb 19, 2022

It's still valid, but it's not checkboxable and is an everpresent worry of mine. I think that we free most of the allocated resources now, so this is less relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ffi Renderer-specific quirks. high lisp-protocol nyxt/lisp URLs and internal pages.
Development

Successfully merging a pull request may close this issue.

2 participants