Skip to content

Commit

Permalink
fix: manifest v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudleyneedham committed Sep 23, 2024
1 parent 09ee37f commit 9dbad3c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/channels/toggleIconChannel/toggleIconChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function toggleIcon(): Promise<void> {
}

export async function produceToggleIcon(): Promise<void> {
await browser.browserAction.setIcon({
await browser.action.setIcon({
path: {
16: 'icon/dark/16.png',
32: 'icon/dark/32.png',
Expand Down
34 changes: 15 additions & 19 deletions src/static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "__MSG_manifest_name__",
"short_name": "__MSG_manifest_short_name__",
"description": "__MSG_manifest_description__",
"version": "2024.9.11",
"version": "2023.3.14",
"default_locale": "en",
"browser_action": {
"action": {
"default_icon": {
"16": "icon/light/16.png",
"32": "icon/light/32.png",
Expand All @@ -15,21 +15,12 @@
"default_popup": "popup.html"
},
"background": {
"scripts": [
"js/backgroundScript.js"
],
"persistent": true
"service_worker": "js/backgroundScript.js"
},
"content_scripts": [
{
"matches": [
"*://*/*"
],
"js": [
"js/contentScript.js"
]
}
],
"content_scripts": [{
"matches": ["*://*/*"],
"js": ["js/contentScript.js"]
}],
"icons": {
"16": "icon/light/16.png",
"32": "icon/light/32.png",
Expand All @@ -41,8 +32,13 @@
"clipboardWrite",
"storage"
],
"content_security_policy": "script-src 'self' 'wasm-eval'; object-src 'self';",
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'"
},
"web_accessible_resources": [
"js/injectedScript.js"
{
"resources": ["js/injectedScript.js"],
"matches": ["*://*/*"]
}
]
}
4 changes: 2 additions & 2 deletions src/utilities/base64/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { TextEncoder } from '@polkadot/x-textencoder';
export function stringToBase64(input: string): string {
const bytes = new TextEncoder().encode(input);
const asciiString = String.fromCodePoint(...bytes);
return window.btoa(asciiString);
return btoa(asciiString);
}

export function base64ToString(base64: string): string {
const asciiString = window.atob(base64);
const asciiString = atob(base64);
const bytes = Uint8Array.from(asciiString, (c) => c.charCodeAt(0));
return new TextDecoder().decode(bytes);
}
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/storageEncryption/storageEncryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ export async function decrypt(
function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string {
const bytes = new Uint8Array(arrayBuffer);
const asciiString = String.fromCodePoint(...bytes);
return window.btoa(asciiString);
return btoa(asciiString);
}

function base64ToArrayBuffer(base64: string): ArrayBuffer {
const asciiString = window.atob(base64);
const asciiString = atob(base64);
return Uint8Array.from(asciiString, (c) => c.charCodeAt(0)).buffer;
}

Expand Down

0 comments on commit 9dbad3c

Please sign in to comment.