Skip to content

Commit

Permalink
Update options page definition in extension manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyaulee committed Jun 14, 2021
1 parent 41b6933 commit 5600049
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ Add a `Popup.razor` Razor component under `Pages` folder with the following cont
### Add an extension options page
Add the following to the `manifest.json`
```json
"options_page": "index.html?path=options"
"options_ui": {
"page": "index.html?path=options",
"open_in_tab": true
}
```
Add a `Options.razor` Razor component under `Pages` folder with the following content.
```razor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
internal enum ManifestItemKey
{
ManifestVersion,
OptionsPage,
OptionsUi,
BrowserAction,
Background,
ContentSecurityPolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static bool TryParseManifestItemKey(string line, out ManifestItemKey? ma
return key switch
{
"manifest_version" => ManifestItemKey.ManifestVersion,
"options_page" => ManifestItemKey.OptionsPage,
"options_ui" => ManifestItemKey.OptionsUi,
"browser_action" => ManifestItemKey.BrowserAction,
"background" => ManifestItemKey.Background,
"content_security_policy" => ManifestItemKey.ContentSecurityPolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"webRequest",
"webRequestBlocking"
],
"options_page": "index.html?path=options",
"options_ui": {
"page": "index.html?path=options",
"open_in_tab": true
},
"browser_action": {
"default_popup": "index.html?path=popup"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"browser_action": {
"default_popup": "index.html?path=popup"
},
"options_page": "index.html?path=options",
"options_ui": {
"page": "index.html?path=options",
"open_in_tab": true
},
"content_scripts": [
{
"matches": [ "*://*/*" ],
Expand Down

0 comments on commit 5600049

Please sign in to comment.