Skip to content

Commit 58df164

Browse files
committed
move folder + instagram inject css
1 parent b906693 commit 58df164

24 files changed

+36
-69
lines changed

manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"<all_urls>"
3434
],
3535
"js": [
36-
"content-scripts/document_start.js"
36+
"scripts/content-scripts/document_start.js"
3737
],
3838
"run_at": "document_start"
3939
},
@@ -42,7 +42,7 @@
4242
"<all_urls>"
4343
],
4444
"js": [
45-
"content-scripts/document_idle.js"
45+
"scripts/content-scripts/document_idle.js"
4646
],
4747
"run_at": "document_idle"
4848
},
@@ -51,16 +51,16 @@
5151
"<all_urls>"
5252
],
5353
"js": [
54-
"content-scripts/document_end.js"
54+
"scripts/content-scripts/document_end.js"
5555
],
5656
"run_at": "document_end"
5757
}
5858
],
5959
"web_accessible_resources": [
6060
{
6161
"resources": [
62-
"content-scripts/*.js",
63-
"content-scripts/*.css"
62+
"scripts/content-scripts/*.js",
63+
"scripts/content-scripts/*.css"
6464
],
6565
"matches": [
6666
"<all_urls>"
@@ -72,7 +72,7 @@
7272
{
7373
"id": "ruleset_1",
7474
"enabled": true,
75-
"path": "net-request-rules/rules.json"
75+
"path": "scripts/net-request-rules/rules.json"
7676
}
7777
]
7878
}

popup/tabs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ const tabs = [
114114
...CATEGORY.instagram,
115115
scripts: [
116116
// s.insta_reloaded,
117-
s.insta_enableDownloadImage,
118117
s.insta_getToken,
119118
s.insta_getUserInfo,
120119
s.insta_getAllUserMedia,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(async () => {
22
// https://stackoverflow.com/a/53033388
3-
const { injectScript, baseURL } = await import("./utils.js");
3+
const { injectScript, baseURL, injectCss } = await import("./utils.js");
44

55
// injectScript(baseURL + "track_settimeout.js");
66
// injectScript(baseURL + "globals_debugger.js");
@@ -9,6 +9,9 @@
99
if (location.hostname === "mp3.zing.vn")
1010
injectScript(baseURL + "mp3.zing.vn.js");
1111

12+
if (location.hostname === "www.instagram.com")
13+
injectCss(baseURL + "instagram.css");
14+
1215
// if (location.hostname === "luanxt.com")
1316
// injectScriptFile("//code.jquery.com/jquery-3.6.1.min.js", true);
1417
})();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
._aagw {
2+
display: none;
3+
}

content-scripts/utils.js renamed to scripts/content-scripts/utils.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const baseURL = "/content-scripts/scripts/";
1+
export const baseURL = "/scripts/content-scripts/scripts/";
22

33
export function injectScript(filePathOrUrl, isExternal = false) {
44
try {
@@ -22,17 +22,22 @@ export function injectScript(filePathOrUrl, isExternal = false) {
2222
}
2323

2424
// https://stackoverflow.com/a/17840622
25-
export function injectCss(cssfile) {
26-
// var css = document.createElement("style");
27-
// if ("textContent" in css) css.textContent = cssText;
28-
// else css.innerText = cssText;
29-
// document.body.appendChild(css);
30-
31-
var css = document.createElement("link");
32-
css.rel = "stylesheet";
33-
css.href = chrome.runtime.getURL(cssfile);
34-
window.onload = () => {
35-
document.body.appendChild(css);
36-
console.log("Useful-scripts injected " + css.href);
37-
};
25+
export function injectCss(cssfileOrCode, isFile = true) {
26+
if (isFile) {
27+
var css = document.createElement("link");
28+
css.rel = "stylesheet";
29+
css.href = chrome.runtime.getURL(cssfileOrCode);
30+
window.onload = () => {
31+
document.body.appendChild(css);
32+
console.log("Useful-scripts injected " + css.href);
33+
};
34+
} else {
35+
var css = document.createElement("style");
36+
if ("textContent" in css) css.textContent = cssText;
37+
else css.innerText = cssText;
38+
window.onload = () => {
39+
document.body.appendChild(css);
40+
console.log("Useful-scripts injected " + css);
41+
};
42+
}
3843
}

scripts/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ import viewAllLinks from "./viewAllLinks.js";
7575
import googleCache from "./googleCache.js";
7676
import githubdev from "./githubdev.js";
7777
import scrollByDrag from "./scrollByDrag.js";
78-
import insta_enableDownloadImage from "./insta_enableDownloadImage.js";
7978
import youtube_viewDislikes from "./youtube_viewDislikes.js";
8079
import downDetector from "./downDetector.js";
8180
import fb_getTokenFfb from "./fb_getTokenFfb.js";
@@ -141,7 +140,6 @@ const allScripts = {
141140
insta_getAllImagesInNewFeed,
142141
BADGES.beta
143142
),
144-
insta_enableDownloadImage: addBadge(insta_enableDownloadImage, BADGES.hot),
145143
insta_getAllImagesInUserProfile,
146144
pictureInPicture: addBadge(pictureInPicture, BADGES.hot),
147145
youtube_toggleLight,

scripts/insta_enableDownloadImage.js

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

scripts/insta_reloaded.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export default {
22
icon: "https://www.google.com/s2/favicons?domain=instagram.com",
33
name: {
4-
en: "Instagram photos/videos downloader",
5-
vi: "Instagram - tải video / hình ảnh",
4+
en: "Instagram reloaded - Download video/image",
5+
vi: "Instagram reloaded - Tải video/ảnh",
66
},
77
description: {
8-
en: "Download ",
9-
vi: "",
8+
en: "View or download the full-size Instagram image/video",
9+
vi: "Xem và tải ảnh/video instagram chất lượng cao",
1010
},
1111
blackList: [],
1212
whiteList: ["*://*.instagram.com/*"],
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)