mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 08:23:25 +00:00
Compare commits
8 Commits
434b2475cb
...
0801f64e1b
Author | SHA1 | Date | |
---|---|---|---|
|
0801f64e1b | ||
|
8735f7b4b2 | ||
|
90f941431c | ||
|
df05547581 | ||
|
a8e3de1451 | ||
|
1801ee238d | ||
|
e2ea8a3c7e | ||
|
213828e818 |
4
.github/workflows/deploying.yml
vendored
4
.github/workflows/deploying.yml
vendored
@@ -94,8 +94,8 @@ jobs:
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./chrome/chrome-mv3-prod.zip
|
||||
asset_name: extension-mw.chrome.crx
|
||||
asset_content_type: application/x-chrome-extension
|
||||
asset_name: extension-mw.chrome.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload Firefox release
|
||||
uses: actions/upload-release-asset@v1
|
||||
|
BIN
assets/active.png
Normal file
BIN
assets/active.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/inactive.png
Normal file
BIN
assets/inactive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
15
package.json
15
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@movie-web/extension",
|
||||
"displayName": "movie-web extension",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"description": "Enhance your movie-web experience with just one click",
|
||||
"author": "movie-web",
|
||||
"scripts": {
|
||||
@@ -54,6 +54,17 @@
|
||||
"gecko": {
|
||||
"id": "{3fd86354-c73f-4395-9e26-2c5c984579bf}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": [
|
||||
"assets/active.png",
|
||||
"assets/inactive.png"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ export function ToggleButton(props: ToggleButtonProps) {
|
||||
</button>
|
||||
</div>
|
||||
<p>
|
||||
Extension {props.active ? 'enabled' : 'disabled'} <br /> on <strong>{props.domain}</strong>
|
||||
Extension <strong>{props.active ? 'enabled' : 'disabled'}</strong> <br /> on <strong>{props.domain}</strong>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
@@ -27,6 +27,11 @@ export function useToggleWhitelistDomain(domain: string) {
|
||||
const { domainWhitelist, addDomain, removeDomain } = useDomainWhitelist();
|
||||
const isWhitelisted = domainWhitelist.includes(domain);
|
||||
const { grantPermission } = usePermission();
|
||||
const iconPath = (chrome || browser).runtime.getURL(isWhitelisted ? 'assets/active.png' : 'assets/inactive.png');
|
||||
|
||||
(chrome || browser).action.setIcon({
|
||||
path: iconPath,
|
||||
});
|
||||
|
||||
const toggle = useCallback(() => {
|
||||
if (!isWhitelisted) {
|
||||
|
Reference in New Issue
Block a user