-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add banner to show that the extension has access.
- Loading branch information
1 parent
1e64131
commit 274805a
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
functional-samples/cookbook.permissions-addsiteaccessrequest/banner.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const banner = document.createElement('div'); | ||
banner.innerText = 'Extension has access to page.'; | ||
|
||
banner.style.width = '100vw'; | ||
banner.style.position = 'fixed'; | ||
banner.style.top = '0'; | ||
banner.style.left = '0'; | ||
banner.style.margin = '0'; | ||
banner.style.borderRadius = '0'; | ||
banner.style.padding = '20px'; | ||
banner.style.background = '#4CAF50'; | ||
banner.style.color = 'white'; | ||
|
||
document.body.prepend(banner); |
10 changes: 8 additions & 2 deletions
10
functional-samples/cookbook.permissions-addsiteaccessrequest/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"name": "permissions.addSiteAccessRequest()", | ||
"name": "Permissions (Add Site Access Request)", | ||
"description": "Uses the `permissions.addSiteAccessRequest()` API to request access to a site.", | ||
"version": "0.3", | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"host_permissions": ["https://example.com/*"], | ||
"permissions": ["tabs"], | ||
"permissions": ["tabs", "scripting"], | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://example.com/*"], | ||
"js": ["banner.js"] | ||
} | ||
], | ||
"manifest_version": 3 | ||
} |