mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 18:13:25 +00:00
Compare commits
11 Commits
434b2475cb
...
1.1.2
Author | SHA1 | Date | |
---|---|---|---|
|
a2eef13d28 | ||
|
90f941431c | ||
|
df05547581 | ||
|
a8e3de1451 | ||
|
1801ee238d | ||
|
e2ea8a3c7e | ||
|
213828e818 | ||
|
01a03cfeb8 | ||
|
d989fd1ee8 | ||
|
2ea2208dea | ||
|
6a3d32dcc3 |
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",
|
"name": "@movie-web/extension",
|
||||||
"displayName": "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",
|
"description": "Enhance your movie-web experience with just one click",
|
||||||
"author": "movie-web",
|
"author": "movie-web",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -54,6 +54,17 @@
|
|||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "{3fd86354-c73f-4395-9e26-2c5c984579bf}"
|
"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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@@ -27,6 +27,11 @@ export function useToggleWhitelistDomain(domain: string) {
|
|||||||
const { domainWhitelist, addDomain, removeDomain } = useDomainWhitelist();
|
const { domainWhitelist, addDomain, removeDomain } = useDomainWhitelist();
|
||||||
const isWhitelisted = domainWhitelist.includes(domain);
|
const isWhitelisted = domainWhitelist.includes(domain);
|
||||||
const { grantPermission } = usePermission();
|
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(() => {
|
const toggle = useCallback(() => {
|
||||||
if (!isWhitelisted) {
|
if (!isWhitelisted) {
|
||||||
|
Reference in New Issue
Block a user