Replies: 1 comment
-
I no longer think this is a good idea as it is titled, since there are and will be multiple browser extensions. Other than the concept of polaris-web and signify-browser-extension sharing the same interface definitions (for how the content-script and web page interact) somewhere ideally common, which should also be versioned. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Restructuring Highlights
Version compatibility
Page communications
Other Changes to improve security, reliability, etc.
The following issues would be addressed a side-effect of these changes
ChatGPT Code
Key Components:
page-bridge.ts
:window.signify
to the web page.Isolated Content Script:
Service Worker:
Code Implementation
1. Manifest File (
manifest.json
):This ensures that the
page-bridge.js
runs in the main world and that permissions are correctly configured.2.
page-bridge.ts
(Main World Content Script with Nested Namespace and Port Communication):The service worker generates the port ID, which the content script uses to establish the connection for secure communication.
The web page can now call the API using the nested namespace under
window.signify
:3.
isolated-content.ts
(Isolated Content Script):The isolated content script listens for messages over the port and forwards them to the service worker.
4.
service-worker.ts
(Service Worker):The service worker generates the random port ID and sends it to the content script for communication over the port.
Summary of Potential Risk Areas and Mitigations
1. Rogue Extension Interference
Rogue extensions could try to interfere with communications or expose global APIs.
Mitigations:
window.signify
object is frozen, preventing rogue scripts from tampering with it.window.signify.extensionAPI_[extensionID]_[version]
isolates the API and reduces the risk of interference.2. Message Tampering or Injection
Rogue extensions might attempt to tamper with or inject messages.
Mitigations:
3. Cross-Extension Message Interception
Rogue extensions could try to intercept messages or listen in on communications between the service worker and the content script.
Mitigations:
4. Privilege Escalation
A rogue extension may attempt to escalate privileges by triggering unauthorized actions in the service worker.
Mitigations:
fetchData
) are processed by the service worker, preventing unauthorized actions.5. Denial of Service (DoS) Attacks
A malicious page or extension could try to flood the extension with messages to degrade performance.
Mitigations:
Beta Was this translation helpful? Give feedback.
All reactions