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

Research extension to Manifest V3 #349

Closed
7 tasks done
hieudd opened this issue Jun 13, 2022 · 0 comments
Closed
7 tasks done

Research extension to Manifest V3 #349

hieudd opened this issue Jun 13, 2022 · 0 comments
Assignees

Comments

@hieudd
Copy link

hieudd commented Jun 13, 2022

Overview

There are many challenges when switching to MV3, this issue is created to listing them and their solutions

Challenges

WASM

  • Use WASM on extension MV3
    • Details: Extension with MV3 is not support run WASM => Some lib like @polkadot/api can not work with full feature
    • Solution: Chrome from version 102 support wasm by add CSP in file manifest.json
      "content_security_policy": {
        "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
      }

Service worker

  • Events

    • Details: Like above isssue, service worker run only when it listen event it will not available all time. This mean extension can not run all time like current background page of MV2, tt run only when use have any interaction. We need to change architect to suitable with them but the good new it will help us optimize extension performance when computer idle. We need to know when which event can make service worker wake up?
    • Solution: Use fetch request to wake up service worker before use it. We can create some special fetch request to service worker and this response utils service worker is ready
  • Message passing problem

  • Life cycle of service worker of an extension

  • Synchronize state:

    • Details: Service worker not run full time but we need to can have more than one service woker? If have more than one service workers how to sync their state between each other?
    • Solution: Need more test but this can be a solution StorageManager.persist()
  • Backup and restore websocket connection

    • Detail: When service worker terminated all WS connection on it will be disconnected, some time we need very long time to connect them again. Have any way to backup and restore to next sevice worker?
    • Solution: Researching...

Idea to resolve above problems

  • Is this idea can be implement and work well on MV3? Have any idea better? Need to research about life cycle of service worker.
    image

Database

  • Use IndexedDB instead of Chrome.local.storage
    • Details: The features of chrome.local.storage are very limited and difficult to extend.
    • Solution: Change to use IndexedDB and Dexie frameworks.
@hieudd hieudd added this to the Milestone 4 milestone Jun 13, 2022
@saltict saltict changed the title Convert extension to Manifest V3 Research extension to Manifest V3 Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants