-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathinsta_enableDownloadImage.js
41 lines (36 loc) · 1.25 KB
/
insta_enableDownloadImage.js
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
export default {
icon: "",
name: {
en: "Enable download instagram photos/videos",
vi: "Cho phép chuột phải tải ảnh/video instagram",
},
description: {
en: "Right click to download instagram photos/videos",
vi: "Bấm chuột phải và tải ảnh/video instagram dễ dàng",
},
blackList: [],
whiteList: ["www.instagram.com"],
func: function () {
const allImgs = Array.from(document.querySelectorAll("img[sizes*=px]"));
const allImageMasks = Array.from(document.querySelectorAll("div._aagw"));
const allVideos = Array.from(document.querySelectorAll("video"));
const allVideoMasks = Array.from(
document.querySelectorAll("div[aria-label='Control']")
);
const allVideoMasks2 = Array.from(document.querySelectorAll("._aakh"));
[...allImageMasks, ...allVideoMasks, ...allVideoMasks2].forEach((mask) => {
mask.remove();
});
allImgs.forEach((img) => {
img.style.zIndex = 9999;
});
allVideos.forEach((video) => {
console.log(video);
window._video = video;
video.controls = true;
// video.controlslist.value = "nofullscreen noremoteplayback";
video.style.zIndex = 9999;
});
alert("Done! can be download photo using right click now!");
},
};