forked from shinigami-eyes/shinigami-eyes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest-v3.patch
93 lines (86 loc) · 2.71 KB
/
manifest-v3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
diff --git a/extension/background.ts b/extension/background.ts
index f247cd1..970e41d 100644
--- a/extension/background.ts
+++ b/extension/background.ts
@@ -1,3 +1,5 @@
+import { BloomFilter, CombinedBloomFilter } from "./bloomfilter.js";
+
var browser: Browser = browser || chrome;
const PENDING_SUBMISSIONS = ':PENDING_SUBMISSIONS'
@@ -843,7 +845,7 @@ function openOptions() {
}
function getURL(path: string) {
- return browser.extension.getURL(path);
+ return chrome.runtime.getURL(path);
}
diff --git a/extension/bloomfilter.ts b/extension/bloomfilter.ts
index d2a990b..6b9d5ad 100644
--- a/extension/bloomfilter.ts
+++ b/extension/bloomfilter.ts
@@ -1,4 +1,4 @@
-class BloomFilter {
+export class BloomFilter {
m: number;
k: number;
@@ -107,7 +107,7 @@ function fnv_mix(a: number) {
return a & 0xffffffff;
}
-class CombinedBloomFilter {
+export class CombinedBloomFilter {
name: LabelKind;
parts: BloomFilter[];
diff --git a/extension/content.ts b/extension/content.ts
index 8d10932..e7d76ea 100644
--- a/extension/content.ts
+++ b/extension/content.ts
@@ -929,7 +929,7 @@ browser.runtime.onMessage.addListener<ShinigamiEyesMessage, ShinigamiEyesSubmiss
linkId: message.linkId,
wantIdForScreenName: twitterUserName
};
- const response = await findTwitterNumericIdsFirefox(request);
+ const response = await findTwitterNumericIdsChrome(request);
const twitterMapping = response.mappings?.filter(x => twitterUserName == x.userName?.toLowerCase())[0];
if (twitterMapping)
message.secondaryIdentifier = 'twitter.com/i/user/' + twitterMapping.numericId;
diff --git a/extension/manifest.json b/extension/manifest.json
index 81c6cad..9827ac1 100644
--- a/extension/manifest.json
+++ b/extension/manifest.json
@@ -1,5 +1,5 @@
{
- "manifest_version": 2,
+ "manifest_version": 3,
"name": "Shinigami Eyes",
"author": "Shinigami Eyes",
"version": "1.0.33",
@@ -118,16 +118,15 @@
"https://x.com/*",
"https://twitter.com/*"
],
+ "world": "MAIN",
"js": [
"content-web.js"
]
}
],
"background": {
- "scripts": [
- "bloomfilter.js",
- "background.js"
- ]
+ "service_worker": "background.js",
+ "type": "module"
},
"options_ui": {
"page": "options.html",
@@ -135,7 +134,9 @@
},
"permissions": [
"contextMenus",
- "storage",
+ "storage"
+ ],
+ "host_permissions": [
"*://*/*"
],
"applications": {