Restructure background script (#70)

Splits some background script functionality into separate modules:
 - Receiver selector handling is moved to ./SelectorManager.
 - Status bridge handling is moved to ./StatusManager.
 - Menu creation and updates are handled in ./createMenus.
 - Shim creation is handled in ./createShim.

TypedEventTarget allows EventTarget-derived classes to export typed events.

Options type definition is moved to ./lib/options, module assumes more responsibility for update handling and provides a "changed" event.

Private cast._requestSession method allows bypassing receiver selector.
This commit is contained in:
Matt Hensman
2019-07-26 00:09:51 +01:00
committed by GitHub
parent 2fe72ed24c
commit ba8c28bf39
40 changed files with 1751 additions and 1241 deletions

View File

@@ -27,6 +27,15 @@
"scripts": [ "main.js" ]
}
, "content_scripts": [
{
"all_frames": true
, "js": [ "shim/content.js" ]
, "matches": [ "<all_urls>" ]
, "run_at": "document_start"
}
]
, "content_security_policy": "CONTENT_SECURITY_POLICY"
, "default_locale": "en"
, "manifest_version": 2