kiến thức Tổng hợp những addon chất cho Firefox / Chromium

mình ko biết code nên bó tay bác ạ
bkHNRA7.png
Thêm luôn vào bộ sưu tập, mở link xem từ Youtube qua Mobile, code rất ezpz:
Code:
// ==UserScript==
// @name         Youtube Watch Mobile
// @description  Youtube Watch Mobile - Scripts
// @include      https://www.youtube.com/*
// @include      https://m.youtube.com/*
// @exclude      https://www.youtube.com/watch*
// @exclude      https://m.youtube.com/watch*
// @namespace    Open Youtube PC and Mobile video links in new tab
// @author       -
// @version      2.0.4
// @license      MIT License
// @grant        GM_openInTab
// @run-at       document-start
// ==/UserScript==
 
var suppressing;
window.addEventListener('mouseup', function(e) {
    if (e.button > 1 || e.altKey)
        return;
    var link = e.target.closest('[href^="/watch"]');
    if (!link ||
        (link.getAttribute('href') || '').match(/^(javascript|#|$)/) ||
        link.href.replace(/#.*/, '') == location.href.replace(/#.*/, '')
    )
        return;
   
    GM_openInTab('https://m.youtube.com' + link.pathname, e.button || e.ctrlKey);
    suppressing = true;
    prevent(e);
}, true);
 
window.addEventListener('click', prevent, true);
window.addEventListener('auxclick', prevent, true);
 
function prevent(e) {
    if (!suppressing)
        return;
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
    setTimeout(function() {
        suppressing = false;
    }, 100);
}
 
Thêm luôn vào bộ sưu tập, mở link xem từ Youtube qua Mobile, code rất ezpz:
Code:
// ==UserScript==
// @name         Youtube Watch Mobile
// @description  Youtube Watch Mobile - Scripts
// @include      https://www.youtube.com/*
// @include      https://m.youtube.com/*
// @exclude      https://www.youtube.com/watch*
// @exclude      https://m.youtube.com/watch*
// @namespace    Open Youtube PC and Mobile video links in new tab
// @author       -
// @version      2.0.4
// @license      MIT License
// @grant        GM_openInTab
// @run-at       document-start
// ==/UserScript==
 
var suppressing;
window.addEventListener('mouseup', function(e) {
    if (e.button > 1 || e.altKey)
        return;
    var link = e.target.closest('[href^="/watch"]');
    if (!link ||
        (link.getAttribute('href') || '').match(/^(javascript|#|$)/) ||
        link.href.replace(/#.*/, '') == location.href.replace(/#.*/, '')
    )
        return;
  
    GM_openInTab('https://m.youtube.com' + link.pathname, e.button || e.ctrlKey);
    suppressing = true;
    prevent(e);
}, true);
 
window.addEventListener('click', prevent, true);
window.addEventListener('auxclick', prevent, true);
 
function prevent(e) {
    if (!suppressing)
        return;
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
    setTimeout(function() {
        suppressing = false;
    }, 100);
}
nhấn vào 1 video thì thấy load link m.youtube xong nhảy về trang chủ bác ạ
 
nhấn vào 1 video thì thấy load link m.youtube xong nhảy về trang chủ bác ạ
Thử lại:
Code:
// ==UserScript==
// @name         Youtube Watch Mobile
// @description  Youtube Watch Mobile - Scripts
// @include      https://www.youtube.com/*
// @include      https://m.youtube.com/*
// @exclude      https://www.youtube.com/watch*
// @exclude      https://m.youtube.com/watch*
// @namespace    Open Youtube PC and Mobile video links in new tab
// @author       -
// @version      2.0.5
// @license      MIT License
// @grant        GM_openInTab
// @run-at       document-start
// ==/UserScript==

var suppressing;
window.addEventListener('mouseup', function(e) {
    if (e.button > 1 || e.altKey)
        return;
    var link = e.target.closest('[href^="/watch"]');
    if (!link ||
        (link.getAttribute('href') || '').match(/^(javascript|#|$)/) ||
        link.href.replace(/#.*/, '') == location.href.replace(/#.*/, '')
    )
        return;
    GM_openInTab('https://m.youtube.com' + link.pathname + link.search, e.button || e.ctrlKey);
    suppressing = true;
    prevent(e);
}, true);

window.addEventListener('click', prevent, true);
window.addEventListener('auxclick', prevent, true);

function prevent(e) {
    if (!suppressing)
        return;
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
    setTimeout(function() {
        suppressing = false;
    }, 100);
}
 
Thử lại:
Code:
// ==UserScript==
// @name         Youtube Watch Mobile
// @description  Youtube Watch Mobile - Scripts
// @include      https://www.youtube.com/*
// @include      https://m.youtube.com/*
// @exclude      https://www.youtube.com/watch*
// @exclude      https://m.youtube.com/watch*
// @namespace    Open Youtube PC and Mobile video links in new tab
// @author       -
// @version      2.0.5
// @license      MIT License
// @grant        GM_openInTab
// @run-at       document-start
// ==/UserScript==

var suppressing;
window.addEventListener('mouseup', function(e) {
    if (e.button > 1 || e.altKey)
        return;
    var link = e.target.closest('[href^="/watch"]');
    if (!link ||
        (link.getAttribute('href') || '').match(/^(javascript|#|$)/) ||
        link.href.replace(/#.*/, '') == location.href.replace(/#.*/, '')
    )
        return;
    GM_openInTab('https://m.youtube.com' + link.pathname + link.search, e.button || e.ctrlKey);
    suppressing = true;
    prevent(e);
}, true);

window.addEventListener('click', prevent, true);
window.addEventListener('auxclick', prevent, true);

function prevent(e) {
    if (!suppressing)
        return;
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
    setTimeout(function() {
        suppressing = false;
    }, 100);
}
được r bác, lúc đầu chưa dc, xoá cookies là dc:adore:
 
Cho mình hỏi có scrit hoặc addon nào khi copy chữ và mở google ra thì có phương án Dán và chạy (tìm kiếm) luôn ko
Hiện nay nó chỉ cho dán chứ ko có option dán và chạy
Cảm ơn
 
Firefox + Facebook Container đủ cho mục đích FB only chưa mấy fen?
Cứ làm sao mà Facebook nó tự mở trong container không chút nhược điểm là ok, còn profile thật không đăng nhập Facebook thì khi vào web linh tinh không bị nút Like, các script .js từ Facebook nó theo dõi, nói chung tự chặn tay bằng uBlock thì tới mùa quít mới hết chi bằng cô lập trong container là ok.

Mà dùng Facebook Container làm gì nhỉ addon này trước nghe nói bị memory leak mà, lại nặng những 396KB ?

Có thể chơi Sidebery rồi tạo luật cho nó nhảy thẳng vào container cũng ngon.

Cái này siêu nhẹ 34KB:
 
À, thêm cái split view cả chỉnh lại vertical tab một chút, chưa có PWA
Tab dọc giờ an phận với Sidebery rồi, hiệu năng tốt, tiện dụng:
1700501081339.png


Nhóm tab lại cho tiện:
1700501107656.png


Kéo thả một cái nó tạo ra Tab Group:
1700501287230.gif


Gập lại có thể cho nó tự động unload tab tiết kiệm RAM:
1700501517555.gif


Ăn đứt cái Tab Group cùi bắp của Chrome dùng bất tiện hơn nhiều:
Chrome_Tab-Groups_In-Line-Image-v7.gif

Tab-Groups-Organization-Example_v1r1.gif
 
Back
Top