Skip to content

Commit 4d241fc

Browse files
author
hoang.tran12
committed
simple allow copy - WIP
1 parent fc47623 commit 4d241fc

15 files changed

+256
-54
lines changed

popup/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ function initSettings() {
485485
}),
486486
showCancelButton: true,
487487
confirmButtonText: t({ vi: "Khởi động lại", en: "Reload" }),
488+
cancelButtonText: t({ vi: "Huỷ", en: "Cancel" }),
488489
}).then((res) => {
489490
if (res.isConfirmed) chrome.runtime.reload();
490491
});

popup/tabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ const tabs = [
696696
...CATEGORY.unlock,
697697
scripts: [
698698
createTitle("--- Unlock web ---", "--- Mở khoá web ---"),
699-
s.removeWebLimit,
700699
s.duckRace_cheat,
701700
s.wheelOfNames_hack,
702701
s.medium_readFullArticle,
@@ -705,9 +704,10 @@ const tabs = [
705704
s.studocu_bypassPreview,
706705
s.studyphim_unlimited,
707706
createTitle("--- Unlock function ---", "--- Mở khoá chức năng ---"),
707+
s.removeWebLimit,
708+
s.simpleAllowCopy,
708709
s.detect_zeroWidthCharacters,
709710
s.injectScriptToWebsite,
710-
s.simpleAllowCopy,
711711
s.showHiddenFields,
712712
s.viewCookies,
713713
s.removeCookies,

scripts/_ufs_statistic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818

1919
whiteList: ["https://useful-script-statistic.glitch.me/log*"],
2020

21-
contentScript: {
21+
pageScript: {
2222
onDocumentEnd: async () => {
2323
const logs = document.body.innerText
2424
.split("\n")

scripts/auto_lockWebsite.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ export default {
9090
};
9191

9292
export const _storage = {
93-
async get(key) {
93+
async get(key, defaultValue) {
9494
let data = await chrome.storage.local.get([key]);
9595
let pass = data?.[key];
96-
return pass;
96+
return pass ?? defaultValue;
9797
},
9898
async set(key, value) {
9999
await chrome.storage.local.set({ [key]: value });
@@ -121,7 +121,7 @@ export const locker = {
121121
sites: {
122122
storageKey: "auto_lock_website_lockedWebsites",
123123
get() {
124-
return _storage.get(this.storageKey) || [];
124+
return _storage.get(this.storageKey, []);
125125
},
126126
async add(site) {
127127
let currentSites = await this.get();

scripts/background-scripts/background_script.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,16 @@ function injectUfsGlobal(tabId, frameId) {
400400
tabId: tabId,
401401
frameIds: [frameId],
402402
},
403-
func: (paths, frameId) => {
403+
func: (paths, frameId, world) => {
404404
paths.forEach((path) => {
405405
import(path)
406-
.then(() => console.log("Ufs import SUCCESS", frameId, path))
407-
.catch((e) => console.error("Ufs import FAILED", frameId, e));
406+
.then(() => console.log("Ufs import SUCCESS", frameId, world, path))
407+
.catch((e) =>
408+
console.error("Ufs import FAILED", frameId, world, e)
409+
);
408410
});
409411
},
410-
args: [paths, frameId],
412+
args: [paths, frameId, world],
411413
world: world,
412414
});
413415
});
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// https://openuserjs.org/scripts/we0019/Tool_Get_Link_Fshare,_4Share.vn,_Mp3zing.vn,_Nhaccuatui,_Tailieu.vn,_hoctot123.com/source
2+
3+
// tool to decode:
4+
// https://deobfuscate.relative.im/
5+
// + manual eval() + replace eval() with console.log()
6+
7+
$(function () {
8+
if (location.pathname.indexOf("/bai-hat/") === 0) {
9+
var code = $("div.fb-like").data("href");
10+
$("#tabService").replaceWith(
11+
' <a id="tabService" href="http://htstar.design/mp3zing.php?q=128&link=' +
12+
code +
13+
'"class="button-style-1 pull-left fn-tab"><i class="zicon icon-download"></i><span>Tải nhạc 128 kbps</span></a> <a id="tabService" href="http://htstar.design/mp3zing.php?q=320&link=' +
14+
code +
15+
'" class="button-style-1 pull-left fn-tab"><i class="zicon icon-download"></i><span>Tải nhạc 320 kbps</span></a> <a id="tabService" href="http://htstar.design/mp3zing.php?q=lossless&link=' +
16+
code +
17+
'" target="_blank" class="button-style-1 pull-left fn-tab"><i class="zicon icon-download"></i><span>Tải nhạc Lossless</span></a> '
18+
);
19+
}
20+
var linkbaihat = $("link[rel='canonical']").attr("href");
21+
if (
22+
$("#btnDownloadBox") ===
23+
'<a href="javascript:;" id="btnDownloadBox"></span>Tải nhạc</a>'
24+
) {
25+
$("#btnDownloadBox").replaceWith(
26+
'<a href="http://htstar.design/nctgetlink.php?q=128&link=' +
27+
linkbaihat +
28+
'"><span class="icon_download"></span> Tải nhạc 128kbps </a><a href="http://htstar.design/nctgetlink.php?q=320&link=' +
29+
linkbaihat +
30+
'"></span> Tải nhạc 320kbps </a><a href="http://htstar.design/nctgetlink.php?q=lossless&link=' +
31+
linkbaihat +
32+
'"></span> Tải nhạc Lossless</a>'
33+
);
34+
} else {
35+
$("#btnAddPlaylistNowPlaying").after(
36+
'<a href="http://htstar.design/nctgetlink.php?q=128&link=' +
37+
linkbaihat +
38+
'"></span> Tải nhạc 128kbps </a></li><a href="http://htstar.design/nctgetlink.php?q=320&link=' +
39+
linkbaihat +
40+
'"></span> Tải nhạc 320kbps </a><a href="http://htstar.design/nctgetlink.php?q=lossless&link=' +
41+
linkbaihat +
42+
'"></span> Tải nhạc Lossless</a>'
43+
);
44+
}
45+
if (location.pathname.indexOf("/file/") === 0) {
46+
{
47+
var link = window.location.href;
48+
var link1 = link.replace("fshare.vn", "getlinkfshare.com");
49+
}
50+
$(".policy_download").prepend(
51+
'<div class="col-xs-12"><a title="Download nhanh " style="margin-top: 10px; height: 70px;" class="btn btn-success btn-lg btn-block btn-download-sms" href="http://bfeu.tk/getfshare.php?link=' +
52+
location.href +
53+
'"> <i class="fa fa-cloud-download fa-2x pull-left"></i> <span class="pull-right text-right download-txt">Tải nhanh File chục mb ^_^ <br><small>Tool Get link From Tiện Ích Máy Tính </small> </span></a></div><div class="col-xs-12"><a title="Download nhanh " style="margin-top: 10px; height: 70px;" class="btn btn-success btn-lg btn-block btn-download-sms" href="' +
54+
link1 +
55+
'"> <i class="fa fa-cloud-download fa-2x pull-left"></i> <span class="pull-right text-right download-txt"> Tải nhanh qua GETLINKFSHARE.COM<br> <small>Tool Get link From Tiện Ích Máy Tính </small> </span></a></div> '
56+
);
57+
}
58+
if (window.location.hostname == "javhd.com") {
59+
var link = window.location.href;
60+
var linkget = "http://htstar.design/getjav.php?link=" + link;
61+
$(".player-container").replaceWith(
62+
'<div> <video autoplay controls> <source src="' +
63+
linkget +
64+
'" type="video/mp4">Your browser does not support HTML5 video.</video></div>'
65+
);
66+
$(".downloads").replaceWith(
67+
'<div><a class="downloads" href="' +
68+
linkget +
69+
'"><i>Downloads</i></a></div>'
70+
);
71+
}
72+
if (window.location.hostname == "tailieu.vn") {
73+
var link = window.location.href;
74+
var linkget = "https://linksvip.net/?link=" + link;
75+
$(".btncam.marginright10").replaceWith(
76+
'<a class="btncam marginright10" style="width:170px;margin:10px 0 0 0px;" title="Download tài liệu qua linksvip.net không cần acc vip" href="' +
77+
linkget +
78+
'"><img valign="middle" src="http://static1.tailieu.vn/b2013az/templates/version1/default/images/down16x21.png">Download qua linksvip' +
79+
"</a>"
80+
);
81+
}
82+
if (window.location.hostname == "hoctot123.com") {
83+
var link = window.location.href;
84+
var linkget = "http://bfeu.tk/getlinkhoctot123/xuly.php?url=" + link;
85+
$("#login_pop").replaceWith(
86+
'<a href="' +
87+
linkget +
88+
'" id="login_pop"><strong style="color:red">DOWNLOAD TÀI LIỆU ĐÃ GET || Tool Get Link from J2TeaM</strong></a>'
89+
);
90+
}
91+
if (window.location.hostname == "4share.vn") {
92+
var link = window.location.href;
93+
var linkget = "https://linksvip.net/?link=" + link;
94+
$("a[href='/payment/card/#FUNNY']").replaceWith(
95+
'<a href="' +
96+
linkget +
97+
'" ><input style="font-weight: bold; color: red" value="DOWNLOAD QUA LINKSVIP" type="button"></a>'
98+
);
99+
}
100+
});
101+
(function ($, window, document) {
102+
"use strict";
103+
GM_addStyle(
104+
".bv-icon{background-image:url(http://static.mp3.zdn.vn/skins/zmp3-v4.1/images/icon.png)!important;background-repeat:no-repeat!important;background-position:-25px -2459px!important;}.bv-download{background-color:#70d4ff!important;border-color:#70d4ff!important;}.bv-download span{color:#fff!important;margin-left:8px!important;}.bv-disable,.bv-download:hover{background-color:#ff5e5e!important;border-color:#ff5e5e!important;}.bv-text{background-image:none!important;color:#fff!important;text-align:center!important;font-size:smaller!important;line-height:25px!important;}.bv-waiting{cursor:wait!important;background-color:#2980b9!important;border-color:#2980b9!important;}.bv-complete,.bv-complete:hover{background-color:#27ae60!important;border-color:#27ae60!important;}.bv-error,.bv-error:hover{background-color:#c0392b!important;border-color:#c0392b!important;}.bv-disable{cursor:not-allowed!important;opacity:0.4!important;}"
105+
);
106+
function downloadSong(songId, progress, complete, error) {
107+
GM_xmlhttpRequest({
108+
method: "GET",
109+
url: linksVip(songId),
110+
responseType: "blob",
111+
onload: function (source) {
112+
complete(source.response, source.finalUrl.split("filename=")[1]);
113+
},
114+
onprogress: function (e) {
115+
if (e.total) {
116+
progress(Math.floor((e.loaded * 100) / e.total) + "%");
117+
} else {
118+
progress("");
119+
}
120+
},
121+
onerror: function (e) {
122+
console.error(e);
123+
error();
124+
},
125+
});
126+
}
127+
window.URL = window.URL || window.webkitURL;
128+
function multiDownloads() {
129+
var $smallBtn = $(".fn-dlsong");
130+
if (!$smallBtn.length) return;
131+
$smallBtn.replaceWith(function () {
132+
var songId = $(this)
133+
.closest("li, .item-song")
134+
.attr("id")
135+
.replace(/(chartitem)?song(rec)?/, "");
136+
return (
137+
'<a title=" Tải nhạc 128kbps " class="bv-download bv-multi-download bv-icon" href="http://htstar.design/mp3zing.php?q=128&code=' +
138+
songId +
139+
'" data-id="' +
140+
songId +
141+
'"><a title=" Tải nhạc 320kbps " class="bv-download bv-multi-download bv-icon" href="http://htstar.design/mp3zing.php?q=320&code=' +
142+
songId +
143+
'" data-id="' +
144+
songId +
145+
'"></a></a><a title=" Tải nhạc Lossless " class="bv-download bv-multi-download bv-icon" target="_blank" href="http://htstar.design/mp3zing.php?q=lossless&code=' +
146+
songId +
147+
'" data-id="' +
148+
songId +
149+
'"></a>'
150+
);
151+
});
152+
}
153+
multiDownloads();
154+
$(document).on("ready", multiDownloads);
155+
$(window).on("load", multiDownloads);
156+
})(jQuery, window, document);

scripts/content-scripts/ufs_global.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const UfsGlobal = {
3232
injectCssFile,
3333
getTrustedPolicy,
3434
createTrustedHtml,
35+
executeScript,
3536
injectScriptSrc,
3637
injectScriptSrcAsync,
3738
isElementInViewport,
@@ -693,6 +694,10 @@ function createTrustedHtml(html) {
693694
let policy = getTrustedPolicy();
694695
return policy.createHTML(html);
695696
}
697+
function executeScript(code) {
698+
let policy = getTrustedPolicy();
699+
return policy.createScript(code);
700+
}
696701
function injectScriptSrc(src, callback) {
697702
let policy = getTrustedPolicy();
698703
let jsSrc = policy.createScriptURL(src);

scripts/fb_getGroupId.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
},
1111
whiteList: ["https://*.facebook.com/*"],
1212

13-
contentScript: {
13+
pageScript: {
1414
onClick: async function () {
1515
// Lấy group id - trường hợp url của group hiển thị tên chứ ko hiển thị id. Ví dụ: https://www.facebook.com/groups/j2team.community.girls
1616

scripts/fb_getPageId.js

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,41 @@ export default {
99
},
1010
whiteList: ["https://www.facebook.com/*"],
1111

12-
contentScript: {
12+
pageScript: {
1313
onClick: function () {
1414
// Lấy page id - khi đang trong trang của page fb. Ví dụ: https://www.facebook.com/ColourfulSpace
1515

16-
const page_name = document.title;
17-
const found = (check) => {
18-
if (check && check[0]) {
19-
prompt(`PAGE ID của ${page_name}:`, check[0]);
20-
return true;
21-
}
22-
return false;
23-
};
24-
if (found(/(?<=\"pageID\"\:\")(.*?)(?=\")/.exec(document.body.innerHTML)))
25-
return;
26-
if (
27-
found(/(?<=facebook\.com\/)(.*?)($|(?=\/)|(?=&))/.exec(location.href))
28-
)
29-
return;
16+
let funcs = [
17+
() =>
18+
require("CometRouteStore").getRoute(location.pathname).rootView.props
19+
.userID,
20+
() => /(?<=\"pageID\"\:\")(.*?)(?=\")/.exec(document.body.innerHTML)[0],
21+
() =>
22+
/(?<=facebook\.com\/)(.*?)($|(?=\/)|(?=&))/.exec(location.href)[0],
23+
() => {
24+
const tags = Array.from(
25+
document.body.querySelectorAll("script:not([src])")
26+
);
27+
for (const tag of tags) {
28+
let matches = tag.textContent.match(/"pageID":"([0-9]+)"/);
29+
if (matches) {
30+
return matches[1];
31+
}
32+
}
33+
return null;
34+
},
35+
];
36+
37+
for (let fn of funcs) {
38+
try {
39+
let result = fn();
40+
if (result) {
41+
prompt("Page ID:", result);
42+
return;
43+
}
44+
} catch (e) {}
45+
}
46+
3047
prompt(
3148
"Không tìm thấy PAGE ID nào trong url!\nBạn có đang ở đúng trang page fb chưa?\nTrang web Ví dụ:",
3249
"https://www.facebook.com/ColourfulSpace"

scripts/fb_getUid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
},
1111
whiteList: ["https://*.facebook.com/*"],
1212

13-
contentScript: {
13+
pageScript: {
1414
onClick: async function () {
1515
// Lấy user id (uid) - khi đang trong tường của người dùng muốn lấy user id. Ví dụ: https://www.facebook.com/callchoulnhe
1616
const { getUidFromUrl } = await import("./fb_GLOBAL.js");

0 commit comments

Comments
 (0)