Skip to content

Commit

Permalink
fix: manifest v3 (#2666)
Browse files Browse the repository at this point in the history
* fix: manifest v3

* feat: updating the version

* feat: updating the version date
  • Loading branch information
Dudleyneedham committed Sep 23, 2024
1 parent 09ee37f commit 434a61f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 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
4 changes: 2 additions & 2 deletions src/components/Settings/__snapshots__/Settings.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ exports[`Settings menu should be visible when menu button clicked 1`] = `
role="menuitem"
tabindex="-1"
>
Version 2024.9.11
Version 2024.9.23
</a>
</li>
</ul>
Expand Down Expand Up @@ -225,7 +225,7 @@ exports[`Settings should render the endpoint item in the internal build 1`] = `
role="menuitem"
tabindex="-1"
>
Version 2024.9.11
Version 2024.9.23
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const internalFeatures: Features = {

// Duplicates the value in src/static/manifest.json
// We can’t use browser.runtime.getManifest().version, as it’s unavailable in injected scripts
const version = '2024.9.11';
const version = '2024.9.23';

export const configuration: ConfigurationType = {
version,
Expand Down
27 changes: 18 additions & 9 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": "2024.9.23",
"default_locale": "en",
"browser_action": {
"action": {
"default_icon": {
"16": "icon/light/16.png",
"32": "icon/light/32.png",
Expand All @@ -15,10 +15,7 @@
"default_popup": "popup.html"
},
"background": {
"scripts": [
"js/backgroundScript.js"
],
"persistent": true
"service_worker": "js/backgroundScript.js"
},
"content_scripts": [
{
Expand All @@ -41,8 +38,20 @@
"clipboardWrite",
"storage"
],
"content_security_policy": "script-src 'self' 'wasm-eval'; object-src 'self';",
"host_permissions": [
"*://*/*"
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
"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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`GenericError should render generic error when an error happens 1`] = `
class="details"
readonly=""
>
Sporran@2024.9.11
Sporran@2024.9.23
Testing GenericError
Expand Down

0 comments on commit 434a61f

Please sign in to comment.