Skip to content

Commit fdc344f

Browse files
Merge pull request #15 from HoangTran0410/dev
hotfix isolated world manifest.json + a lot of new features + fix bugs
2 parents b5ad89b + 2edde7a commit fdc344f

File tree

120 files changed

+4654
-2322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+4654
-2322
lines changed

empty_script.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default {
77
description: {
88
en: "",
99
vi: "",
10+
img: "",
1011
},
1112
infoLink: "",
1213

manifest.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,29 @@
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+
},
3036
{
3137
"matches": ["<all_urls>"],
3238
"js": ["scripts/content-scripts/document_start.js"],
33-
"run_at": "document_start"
39+
"run_at": "document_start",
40+
"world": "ISOLATED"
3441
},
3542
{
3643
"matches": ["<all_urls>"],
3744
"js": ["scripts/content-scripts/document_idle.js"],
38-
"run_at": "document_idle"
45+
"run_at": "document_idle",
46+
"world": "ISOLATED"
3947
},
4048
{
4149
"matches": ["<all_urls>"],
4250
"js": ["scripts/content-scripts/document_end.js"],
43-
"run_at": "document_end"
51+
"run_at": "document_end",
52+
"world": "ISOLATED"
4453
}
4554
],
4655
"web_accessible_resources": [

popup/helpers/category.js

-21
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ export const CATEGORY = {
3232
vi: `<i class="fa-solid fa-play fa-beat-fade" style="color:#1F51FF"></i> Tự động chạy`,
3333
},
3434
},
35-
ai: {
36-
id: "ai",
37-
name: {
38-
en: `<i class="fa-solid fa-robot"></i> AI`,
39-
vi: `<i class="fa-solid fa-robot"></i> AI`,
40-
},
41-
},
4235
search: {
4336
id: "search",
4437
name: {
@@ -88,20 +81,6 @@ export const CATEGORY = {
8881
vi: `<i class="fa-brands fa-tiktok"></i> Tiktok`,
8982
},
9083
},
91-
shopping: {
92-
id: "shopping",
93-
name: {
94-
en: `<i class="fa-solid fa-cart-shopping"></i> Shopping`,
95-
vi: `<i class="fa-solid fa-cart-shopping"></i> Mua sắm`,
96-
},
97-
},
98-
github: {
99-
id: "github",
100-
name: {
101-
en: `<i class="fa-brands fa-github"></i> Github`,
102-
vi: `<i class="fa-brands fa-github"></i> Github`,
103-
},
104-
},
10584
automation: {
10685
id: "automation",
10786
name: {

popup/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ function createScriptButton(script, isFavorite = false) {
288288
// tooltip
289289
const tooltip = document.createElement("span");
290290
tooltip.classList.add("tooltiptext");
291-
tooltip.innerText = t(script.description);
291+
tooltip.innerHTML = t(script.description);
292+
if (script.description?.img) {
293+
tooltip.innerHTML += `<img src="${script.description.img}" style="width:95%" />`;
294+
}
292295
button.appendChild(tooltip);
293296

294297
buttonContainer.appendChild(button);

popup/main.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import("./index.js").then(() => {
22
document.querySelector("#loading-fullscreen")?.remove();
33
});
4+
5+
import("../scripts/content-scripts/scripts/ufs_global_webpage_context.js").then(() => {
6+
console.log("loaded ufs_global_webpage_context")
7+
})

popup/popup.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ <h3 class="modal-title">Modal Title</h3>
6161
<div class="loader"></div>
6262
</div>
6363

64-
<script src="../scripts/content-scripts/scripts/ufs_global_webpage_context.js"></script>
65-
<!-- <script type="module" src="./index.js"></script> -->
6664
<script src="main.js"></script>
6765
</body>
6866

69-
</html>
67+
</html>

popup/styles/style.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ a:hover {
319319
border-radius: 6px;
320320
padding: 5px;
321321
pointer-events: none;
322+
width: calc(100vw - 40px);
322323

323324
/* Position the tooltip */
324325
position: absolute;
@@ -536,4 +537,4 @@ a:hover {
536537
/* Handle on hover */
537538
::-webkit-scrollbar-thumb:hover {
538539
background: #555;
539-
}
540+
}

0 commit comments

Comments
 (0)