Last active
January 12, 2025 02:20
-
-
Save beebeo/7b454b776577d7c0ac9c91a054cf50cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open Instagram App | |
// @version 1.0.0 | |
// @author beebeo | |
// @match *://*.instagram.com/* | |
// @downloadURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-instagram-app.user.js | |
// @updateURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-instagram-app.user.js | |
// @homepage https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/ | |
// ==/UserScript== | |
let redirect = document.querySelector('[property="al:ios:url"]')?.getAttribute('content') | |
if (redirect) { | |
window.location.href = redirect; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open Reddit App | |
// @version 1.0.0 | |
// @author beebeo | |
// @match *://*.reddit.com/* | |
// @downloadURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-reddit-app.user.js | |
// @updateURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-reddit-app.user.js | |
// @homepage https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/ | |
// ==/UserScript== | |
window.location.href = location.href.replace('https://', 'reddit://'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open Spotify App | |
// @version 1.0.0 | |
// @author beebeo | |
// @match *://*.spotify.com/* | |
// @downloadURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-spotify-app.user.js | |
// @updateURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-spotify-app.user.js | |
// @homepage https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/ | |
// ==/UserScript== | |
let redirect = document.querySelector('[name="al:ios:url"]')?.getAttribute('content') | |
if (redirect) { | |
window.location.href = redirect; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open TikTok App | |
// @version 1.0.2 | |
// @author beebeo | |
// @match *://*.tiktok.com/* | |
// @downloadURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-tiktok-app.user.js | |
// @updateURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-tiktok-app.user.js | |
// @homepage https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/ | |
// ==/UserScript== | |
let redirect = document.querySelector('[property="al:ios:url"]')?.getAttribute('content') | |
if (redirect === 'snssdk1180://user/profile/') { | |
let data = JSON.parse(document.getElementById('SIGI_STATE').textContent) | |
redirect += Object.values(data.UserModule?.users || data.MobileUserModule?.users)[0].id | |
} | |
if (location.pathname.includes('/view/product/')) { | |
let searchParam = new URLSearchParams(window.location.search) | |
let render_data = JSON.parse(decodeURIComponent(document.getElementById('RENDER_DATA').textContent)) | |
let tiktok_shop = 'snssdk1233://ec/pdp?gd_label={{gd_label}}&needlaunchlog=1&page_name=reflow_pdp¶ms_url={{location.href}}&refer=web&requestParams=%7B%22product_id%22%3A%5B%22{{product_id}}%22%5D%7D&trackParams={{trackParams}}' | |
let direct_shop = tiktok_shop.replace('{{gd_label}}', 'click_wap_pdp').replace('{{location.href}}', encodeURIComponent(location.href)).replace('{{product_id}}', render_data[2].initialData.productInfo.product_id).replace('{{trackParams}}', encodeURIComponent(searchParam.get('trackParams'))) | |
redirect = direct_shop | |
} | |
if (redirect) window.location.href = redirect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open Twitter App | |
// @version 1.0.0 | |
// @author beebeo | |
// @match *://mobile.twitter.com/* | |
// @downloadURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-twitter-app.user.js | |
// @updateURL https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/raw/open-twitter-app.user.js | |
// @homepage https://gist.github.com/beebeo/7b454b776577d7c0ac9c91a054cf50cb/ | |
// ==/UserScript== | |
function redirect () { | |
let type = document.querySelector('[property="og:type"]')?.getAttribute('content') | |
if (type === 'article') window.location.href = 'twitter://tweet?id=' + location.pathname.split('/').at(-1) | |
if (type === 'profile') window.location.href = 'twitter://user?screen_name=' + location.pathname.split('/').at(-1) | |
!type && requestAnimationFrame(redirect) | |
} | |
redirect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Phương Bách mãi đỉnh