Skip to content

Commit 07aad60

Browse files
committed
fix
1 parent 7b3bd6c commit 07aad60

File tree

8 files changed

+32
-45
lines changed

8 files changed

+32
-45
lines changed

manifest.json

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,47 +27,40 @@
2727
"host_permissions": ["<all_urls>"],
2828
"options_page": "./pages/options/options.html",
2929
"content_scripts": [
30-
{
31-
"matches": ["<all_urls>"],
32-
"js": ["scripts/content-scripts/scripts/ufs_global_webpage_context.js"],
33-
"run_at": "document_start",
34-
"world": "MAIN"
35-
},
36-
{
37-
"matches": ["<all_urls>"],
38-
"js": ["scripts/content-scripts/scripts/ufs_global_webpage_context.js"],
39-
"run_at": "document_start",
40-
"world": "ISOLATED"
41-
},
4230
{
4331
"matches": ["<all_urls>"],
4432
"js": ["scripts/content-scripts/content_script.js"],
4533
"run_at": "document_start",
46-
"world": "ISOLATED"
47-
},
48-
{
49-
"matches": ["<all_urls>"],
50-
"js": ["scripts/content-scripts/run_scripts.js"],
51-
"run_at": "document_start",
52-
"world": "MAIN"
34+
"world": "ISOLATED",
35+
"match_origin_as_fallback": true,
36+
"match_about_blank": true
5337
},
5438
{
5539
"matches": ["<all_urls>"],
56-
"js": ["scripts/content-scripts/document_start.js"],
40+
"js": [
41+
"scripts/content-scripts/scripts/ufs_global_webpage_context.js",
42+
"scripts/content-scripts/run_scripts.js"
43+
],
5744
"run_at": "document_start",
58-
"world": "MAIN"
45+
"world": "MAIN",
46+
"match_origin_as_fallback": true,
47+
"match_about_blank": true
5948
},
6049
{
6150
"matches": ["<all_urls>"],
6251
"js": ["scripts/content-scripts/document_idle.js"],
6352
"run_at": "document_idle",
64-
"world": "MAIN"
53+
"world": "MAIN",
54+
"match_origin_as_fallback": true,
55+
"match_about_blank": true
6556
},
6657
{
6758
"matches": ["<all_urls>"],
6859
"js": ["scripts/content-scripts/document_end.js"],
6960
"run_at": "document_end",
70-
"world": "MAIN"
61+
"world": "MAIN",
62+
"match_origin_as_fallback": true,
63+
"match_about_blank": true
7164
}
7265
],
7366
"web_accessible_resources": [

popup/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ function createTabs() {
6868
// show scripts count
6969
if (tab.showCount) {
7070
let avaiCount = tab.scripts.filter((script) => !isTitle(script)).length;
71-
let allCount = Object.keys(allScripts).length;
72-
tabBtn.innerHTML += ` (${avaiCount}/${allCount})`;
71+
tabBtn.innerHTML += ` (${avaiCount})`;
7372
}
7473

7574
// custom style

popup/tabs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const tabs = [
2828
{
2929
...CATEGORY.search,
3030
scripts: [
31-
// s._test,
31+
s._test,
3232
s.search_userscript,
3333
s.whatFont,
3434
s.similarWeb,
@@ -49,10 +49,10 @@ const tabs = [
4949
...CATEGORY.download,
5050
scripts: [
5151
createTitle("--- All in one ---", "--- Tổng hợp ---"),
52-
s.savevideo_me,
52+
s.vuiz_getLink,
5353
s.saveAllVideo,
54+
s.savevideo_me,
5455
s.getLinkLuanxt,
55-
s.vuiz_getLink,
5656
// s.bookmark_exporter,
5757
s.twitter_downloadButton,
5858
createTitle("--- Music ---", "--- Nhạc ---"),

scripts/content-scripts/content_script.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import("./scripts/ufs_global_webpage_context.js");
2+
13
// communication between page-script and content-script
24
(() => {
35
function sendToPageScript(event, data) {
@@ -39,7 +41,9 @@
3941
switch (message.type) {
4042
case MsgType.runScript:
4143
let scriptId = message.scriptId;
42-
const script = (await import("../" + scriptId + ".js"))?.default;
44+
const script = (
45+
await import(chrome.runtime.getURL("/scripts/") + scriptId + ".js")
46+
)?.default;
4347

4448
if (script && isFunction(script[ClickType.onClickContentScript])) {
4549
script[ClickType.onClickContentScript]();

scripts/content-scripts/document_start.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/content-scripts/scripts/ufs_global_webpage_context.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,3 @@ const UsefulScriptsUtils = {
13461346
downloadData: UsefulScriptGlobalPageContext.Utils.downloadData,
13471347
};
13481348
window.UsefulScriptsUtils = UsefulScriptsUtils;
1349-
1350-
// ================================= Polyfill =================================
1351-
// Chrome pre-34
1352-
if (!Element.prototype.matches)
1353-
Element.prototype.matches = Element.prototype.webkitMatchesSelector;

scripts/fb_whoIsTyping.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export default {
2020
websocket_instant.addEventListener("message", async function (achunk) {
2121
let utf8_str = textDecoder.decode(achunk.data);
2222

23+
console.log(utf8_str, achunk);
24+
2325
if (
2426
utf8_str.startsWith("1") &&
2527
utf8_str.includes("updateTypingIndicator")

working_note.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
- [ ] Crack tải pdf trên tailieugiangday.vn dễ vl
2222

23-
- [ ] Optimize import jszip
23+
- [x] Optimize import jszip => có lẽ không cần
2424

2525
- [x] làm cho xong soundcloud_downloadMusic hoặc xóa => Xong rồi, Ngon
2626

27-
- [ ] Move transfer.sh sang popup
27+
- [x] Move transfer.sh sang popup => Xoá luôn
2828

29-
- [ ] text to qrcode không còn hoạt động
29+
- [x] text to qrcode không còn hoạt động => xoá luôn, ít xài
30+
31+
- [ ] bookmark exporter/manager

0 commit comments

Comments
 (0)