Skip to content

Commit 4a3640c

Browse files
authored
Merge pull request #49 from foooomio/release
Release v3.0.4
2 parents 7301852 + 87b7154 commit 4a3640c

11 files changed

Lines changed: 49 additions & 51 deletions

File tree

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"format-check": "prettier --check ."
1414
},
1515
"devDependencies": {
16-
"@playwright/test": "^1.44.1",
16+
"@playwright/test": "^1.45.1",
1717
"@types/chrome": "^0.0.268",
18-
"@types/node": "^20.12.12",
19-
"prettier": "^3.2.5",
20-
"typescript": "^5.4.5"
18+
"@types/node": "^20.14.9",
19+
"prettier": "^3.3.2",
20+
"typescript": "^5.5.3"
2121
}
2222
}

src/background.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
'use strict';
22

3-
chrome.contextMenus.create(
4-
{
5-
contexts: ['page', 'frame', 'selection', 'link', 'editable', 'image'],
6-
documentUrlPatterns: ['http://*/*', 'https://*/*', 'file:///*/*'],
7-
id: 'background_img',
8-
title: chrome.i18n.getMessage('extName'),
9-
},
10-
() => {
11-
if (chrome.runtime.lastError) {
12-
console.log(chrome.runtime.lastError);
13-
}
14-
},
15-
);
3+
chrome.runtime.onInstalled.addListener(() => {
4+
chrome.contextMenus.removeAll(() => {
5+
chrome.contextMenus.create({
6+
contexts: ['page', 'frame', 'selection', 'link', 'editable', 'image'],
7+
documentUrlPatterns: ['http://*/*', 'https://*/*', 'file:///*/*'],
8+
id: 'background_img',
9+
title: chrome.i18n.getMessage('extName'),
10+
});
11+
});
12+
});
1613

1714
const cache = new Map();
1815

src/manifest.chrome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_extName__",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"description": "__MSG_extDescription__",
66
"default_locale": "en",
77
"permissions": ["contextMenus"],

src/manifest.firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_extName__",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"description": "__MSG_extDescription__",
66
"default_locale": "en",
77
"permissions": ["contextMenus"],

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_extName__",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"description": "__MSG_extDescription__",
66
"default_locale": "en",
77
"permissions": ["contextMenus"],

src/viewer/connection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export async function getImages(key) {
3535
if (typeof response === 'string') {
3636
throw new Error(response);
3737
} else {
38-
console.error(response);
39-
throw new Error('Unknown error.');
38+
throw new Error('Unknown error.', { cause: response });
4039
}
4140
}
4241

4342
localStorage.setItem(key, JSON.stringify(response));
43+
4444
return response;
4545
}

src/viewer/error.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export function showError(error) {
88
$('error').classList.remove('hidden');
99
$('nav').classList.add('hidden');
1010

11-
const [firefox, version] = navigator.userAgent.match(/Firefox\/(\d+)/) ?? [];
12-
if (firefox != null && Number(version) < 127) {
11+
if (navigator.userAgent.includes('Gecko')) {
1312
$('error-firefox').classList.remove('hidden');
1413
}
1514
}

src/viewer/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ try {
1717

1818
setupGallery(images);
1919
} catch (error) {
20+
console.dir(error);
2021
if (error instanceof Error) {
2122
showError(error);
2223
}

src/viewer/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ h1 {
4545
max-width: 100%;
4646
max-height: 80vh;
4747
transition: 0.2s;
48+
box-shadow: 0 0 2rem 1rem #333;
4849
}
4950

5051
#gallery figcaption {

tests/locales.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from 'node:assert';
1+
import assert from 'node:assert/strict';
22
import test from 'node:test';
33
import fs from 'node:fs/promises';
44

0 commit comments

Comments
 (0)