8 Commits

Author SHA1 Message Date
William Oldham
0801f64e1b Fix content type for extension deployment 2024-03-05 21:13:59 +00:00
William Oldham
8735f7b4b2 Update deploying.yml 2024-03-05 21:13:22 +00:00
William Oldham
90f941431c Bump extension to 1.1.2 2024-03-05 18:51:26 +00:00
William Oldham
df05547581 Merge pull request #23 from movie-web/feature/#867
add inactive icon if the domain is not whitelisted
2024-03-05 18:51:01 +00:00
William Oldham
a8e3de1451 Update inactive logo and bold enabled/disabled 2024-03-05 18:46:37 +00:00
Jorrin
1801ee238d Delete icon.development.png 2024-03-04 21:51:15 +01:00
Jorrin
e2ea8a3c7e remove unused useEffect 2024-03-04 21:45:37 +01:00
Jorrin
213828e818 add inactive icon if the domain is not whitelisted 2024-03-03 22:56:13 +01:00
6 changed files with 21 additions and 5 deletions

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
assets/inactive.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -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>"
]
}
]
}
}

View File

@@ -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>
);

View File

@@ -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) {