Skip to content

Commit 57fd56e

Browse files
committed
WIP
1 parent b99414c commit 57fd56e

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

scripts/auto_redirectLargestImageSrc_rules.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
// https://greasyfork.org/en/scripts/24204-picviewer-ce
2+
3+
/*
4+
{
5+
name: unique name for this rule
6+
url: regex for url that this rule support
7+
src: regex for img src that this rule support
8+
r: regex(s) for string that will be replaced
9+
s: regex(s) for string that will be added
10+
}
11+
*/
12+
113
export default [
214
{
315
// https://i1.sndcdn.com/avatars-IMMW4scIEiCxzOrR-hbX1hw-t240x240.jpg

scripts/content-scripts/ufs_global.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,7 @@ async function getLargestImageSrc(imgSrc, webUrl) {
12031203

12041204
async function try2() {
12051205
if (!CACHED.largeImgSiteRules) {
1206-
let url = await getURL("/scripts/auto_redirectLargestImageSrc_rules.js");
1207-
let s = await import(url);
1206+
let s = await import("../auto_redirectLargestImageSrc_rules.js");
12081207
CACHED.largeImgSiteRules = s.default;
12091208
}
12101209
for (let rule of CACHED.largeImgSiteRules) {

scripts/youtube_viewDislikes.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,18 @@ function isNewDesign() {
200200
function numberFormat(numberState) {
201201
return UfsGlobal.Utils.getNumberFormatter("compactShort").format(numberState);
202202
}
203+
204+
// Information gathering: https://greasyfork.org/en/scripts/471103-youtubedl/code
205+
function getVideoInformation(url) {
206+
const regex =
207+
/(?:https?:\/\/(?:www\.)?youtube\.com\/(?:watch\?v=|shorts\/|embed\/)?)([\w-]+)/i;
208+
const match = regex.exec(url);
209+
const videoId = match ? match[1] : null;
210+
211+
let type = null;
212+
if (url.includes("/shorts/")) type = "shorts";
213+
else if (url.includes("/watch?v=")) type = "video";
214+
else if (url.includes("/embed/")) type = "embed";
215+
216+
return { type, videoId };
217+
}

working_note.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
## 28/04/2024 - 24/05/2024
44

5-
- [ ] Fix simple allow copy <https://chrome.google.com/webstore/detail/aefehdhdciieocakfobpaaolhipkcpgc>
5+
- [ ] update rules cho auto inlarge image <https://chromewebstore.google.com/detail/hover-zoom+/pccckmaobkjjboncdfnnofkonhgpceea>
66

7-
- [ ] optimize prevent close browser on last tab, try debounce/throttle
7+
- [ ] Update contributor guide khi release ver mới
88

9-
- [ ] import UfsGlobal thay vì để global + tách nhỏ UfsGobal
9+
- [x] Fix simple allow copy <https://chrome.google.com/webstore/detail/aefehdhdciieocakfobpaaolhipkcpgc>
10+
11+
- [x] optimize prevent close browser on last tab, try debounce/throttle => chắc ko optimize đc nữa
12+
13+
- [x] import UfsGlobal thay vì để global + tách nhỏ UfsGobal
1014

1115
- [x] Show recently closed tabs => Bỏ, browser có sẵn rồi
1216

@@ -18,7 +22,7 @@
1822

1923
- [x] save to facebook <https://chromewebstore.google.com/detail/save-to-facebook/jmfikkaogpplgnfjmbjdpalkhclendgd> => Cần load script/css từ facebook => không ổn
2024

21-
- [ ] youtube dislike UI
25+
- [x] youtube dislike UI
2226

2327
- [x] Switch to Swal
2428

@@ -68,7 +72,7 @@
6872

6973
- [x] Boost timer + bypass all short link <https://greasyfork.org/en/scripts/431691-bypass-all-shortlinks> => Not interested
7074

71-
- [ ] call js function from url <https://stackoverflow.com/a/8466513/23648002>
75+
- [x] call js function from url <https://stackoverflow.com/a/8466513/23648002> => chưa biết áp dụng làm gì
7276

7377
```
7478
chrome.tabs.update(tabId, {url: 'javascript:functionNameHere()'});

0 commit comments

Comments
 (0)