Skip to content

Commit ee3a088

Browse files
authored
deps: update for 0.16.0
deps: update dependencies for electron, replaywebpage, wabac.js (#332) cleanup: use globalThis instead of self
1 parent 81ef2cd commit ee3a088

File tree

3 files changed

+139
-111
lines changed

3 files changed

+139
-111
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@webrecorder/archivewebpage",
33
"productName": "ArchiveWeb.page",
4-
"version": "0.15.9",
4+
"version": "0.16.0",
55
"main": "index.js",
66
"description": "Create Web Archives directly in your browser",
77
"repository": {
@@ -14,9 +14,9 @@
1414
"@fortawesome/fontawesome-free": "^5.13.0",
1515
"@ipld/car": "^5.3.2",
1616
"@ipld/unixfs": "^3.0.0",
17-
"@webrecorder/wabac": "^2.24.5",
17+
"@webrecorder/wabac": "^2.25.2",
1818
"auto-js-ipfs": "^2.3.0",
19-
"browsertrix-behaviors": "^0.9.5",
19+
"browsertrix-behaviors": "^0.9.7",
2020
"btoa": "^1.2.1",
2121
"bulma": "^0.9.3",
2222
"client-zip": "^2.3.0",
@@ -28,7 +28,7 @@
2828
"p-queue": "^8.0.1",
2929
"pdfjs-dist": "2.2.228",
3030
"pretty-bytes": "^5.6.0",
31-
"replaywebpage": "^2.3.23",
31+
"replaywebpage": "^2.4.0",
3232
"stream-browserify": "^3.0.0",
3333
"tsconfig-paths-webpack-plugin": "^4.1.0",
3434
"unused-filename": "^4.0.1",
@@ -43,7 +43,7 @@
4343
"@typescript-eslint/parser": "^6.15.0",
4444
"copy-webpack-plugin": "^9.0.1",
4545
"css-loader": "^6.2.0",
46-
"electron": "^38.2.1",
46+
"electron": "^39.2.6",
4747
"electron-builder": "^26.0.12",
4848
"electron-notarize": "^1.2.2",
4949
"eslint": "^8.28.0",
@@ -63,13 +63,13 @@
6363
"ts-loader": "^9.5.1",
6464
"ts-migrate": "^0.1.35",
6565
"typescript": "^5.3.3",
66-
"webpack": "^5.99.7",
66+
"webpack": "^5.103.0",
6767
"webpack-cli": "^5.1.4",
6868
"webpack-dev-server": "^5.0.4",
6969
"webpack-extension-reloader": "^1.1.4"
7070
},
7171
"resolutions": {
72-
"@webrecorder/wabac": "^2.24.5"
72+
"@webrecorder/wabac": "^2.25.2"
7373
},
7474
"files": [
7575
"src/",

src/localstorage.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// @ts-expect-error - TS7006 - Parameter 'name' implicitly has an 'any' type. | TS7006 - Parameter 'value' implicitly has an 'any' type.
22
export function setLocalOption(name, value) {
33
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'. | TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
4-
if (self.chrome?.storage) {
4+
if (globalThis.chrome?.storage) {
55
return new Promise((resolve) => {
66
const data = {};
77
// @ts-expect-error - TS7053 - Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.
88
data[name] = value;
99
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'. | TS2794 - Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
10-
self.chrome.storage.local.set(data, () => resolve());
10+
globalThis.chrome.storage.local.set(data, () => resolve());
1111
});
1212
}
1313

14-
if (self.localStorage) {
14+
if (globalThis.localStorage) {
1515
return Promise.resolve(localStorage.setItem(name, value));
1616
}
1717

@@ -21,16 +21,16 @@ export function setLocalOption(name, value) {
2121
// ===========================================================================
2222
export function getLocalOption(name: string): Promise<string | null> {
2323
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'. | TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
24-
if (self.chrome?.storage) {
24+
if (globalThis.chrome?.storage) {
2525
return new Promise<string>((resolve) => {
2626
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
27-
self.chrome.storage.local.get(name, (res) => {
27+
globalThis.chrome.storage.local.get(name, (res) => {
2828
resolve(res[name]);
2929
});
3030
});
3131
}
3232

33-
if (self.localStorage) {
33+
if (globalThis.localStorage) {
3434
return Promise.resolve(localStorage.getItem(name));
3535
}
3636

@@ -41,17 +41,17 @@ export function getLocalOption(name: string): Promise<string | null> {
4141
// @ts-expect-error - TS7006 - Parameter 'name' implicitly has an 'any' type.
4242
export function removeLocalOption(name) {
4343
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'. | TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
44-
if (self.chrome?.storage) {
44+
if (globalThis.chrome?.storage) {
4545
return new Promise((resolve) => {
4646
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
47-
self.chrome.storage.local.remove(name, () => {
47+
globalThis.chrome.storage.local.remove(name, () => {
4848
// @ts-expect-error - TS2794 - Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
4949
resolve();
5050
});
5151
});
5252
}
5353

54-
if (self.localStorage) {
54+
if (globalThis.localStorage) {
5555
return Promise.resolve(localStorage.removeItem(name));
5656
}
5757

0 commit comments

Comments
 (0)