-
-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathinjectScriptToWebsite.js
More file actions
32 lines (30 loc) · 896 Bytes
/
injectScriptToWebsite.js
File metadata and controls
32 lines (30 loc) · 896 Bytes
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
export default {
icon: '<i class="fa-solid fa-virus fa-lg"></i>',
name: {
en: "Inject script to website",
vi: "Nhúng script vào trang web",
},
description: {
en: "Inject script url to current website, eg. jquery, library, etc.",
vi: "Nhúng link script vào website, ví dụ nhúng jquery, thư viện js, ...",
},
onClick: function () {
let url = prompt(
"Enter script url / Nhập link script: ",
"//code.jquery.com/jquery-3.6.1.min.js"
);
if (url) {
UfsGlobal.DOM.injectScriptSrc(url, (success, error) => {
if (success) {
alert("Inject SUCCESS.\n\n" + url);
} else {
alert("Inject FAILED.\n\n" + JSON.stringify(error));
}
});
}
},
};
function backup() {
// https://stackoverflow.com/a/38840724/11898496
// Script loader: https://plnkr.co/edit/b9O19f?p=preview&preview
}