You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/localstorage.ts
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
// @ts-expect-error - TS7006 - Parameter 'name' implicitly has an 'any' type. | TS7006 - Parameter 'value' implicitly has an 'any' type.
2
2
exportfunctionsetLocalOption(name,value){
3
3
// @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){
5
5
returnnewPromise((resolve)=>{
6
6
constdata={};
7
7
// @ts-expect-error - TS7053 - Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.
8
8
data[name]=value;
9
9
// @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'?
// @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){
25
25
returnnewPromise<string>((resolve)=>{
26
26
// @ts-expect-error - TS2339 - Property 'chrome' does not exist on type 'Window & typeof globalThis'.
// @ts-expect-error - TS7006 - Parameter 'name' implicitly has an 'any' type.
42
42
exportfunctionremoveLocalOption(name){
43
43
// @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){
45
45
returnnewPromise((resolve)=>{
46
46
// @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,()=>{
48
48
// @ts-expect-error - TS2794 - Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
0 commit comments