Greasy Fork is available in English.

Adatvédelmi átirányító

A közösségi médiaplatformok átirányítása az adatvédelem-barát kezdőlapokra

Mint 2023.01.02.. Lásd a legutóbbi verzió

  1. // ==UserScript==
  2. // @name Privacy Redirector
  3. // @name:bg Пренасочване на поверителността
  4. // @name:br Rediretor de privacidade
  5. // @name:cs Přesměrování soukromí
  6. // @name:de Datenschutz Umleiter
  7. // @name:da Omdirigeringsenhed for privatlivets fred
  8. // @name:et Privaatsuse ümbersuunaja
  9. // @name:es Redirección de privacidad
  10. // @name:fi Yksityisyydensuojan uudelleenohjaus
  11. // @name:fr Redirecteur de confidentialité
  12. // @name:el Επανακατευθυντής απορρήτου
  13. // @name:hu Adatvédelmi átirányító
  14. // @name:id Pengarah Privasi
  15. // @name:it Reindirizzatore di privacy
  16. // @name:ja プライバシーリダイレクト
  17. // @name:lt Privatumo nukreipiklis
  18. // @name:lv Konfidencialitātes pāradresētājs
  19. // @name:nl Privacy-omleiding
  20. // @name:pl Przekierownik prywatności
  21. // @name:pt Redirector de Privacidade
  22. // @name:ro Redirector de confidențialitate
  23. // @name:ru Перенаправление конфиденциальности
  24. // @name:sv Omdirigering av sekretess
  25. // @name:sl Preusmerjevalnik zasebnosti
  26. // @name:sk Presmerovanie súkromia
  27. // @name:tr Gizlilik Yönlendiricisi
  28. // @name:uk Редиректор конфіденційності
  29. // @name:zh 隐私重定向器
  30. // @name:zh-CN 隐私重定向器
  31. // @description Redirect social media platforms to their privacy respecting frontends
  32. // @description:bg Пренасочване на платформите за социални медии към заглавните им страници, съобразени с поверителността
  33. // @description:br Redirecionando as plataformas de mídia social para suas primeiras páginas de privacidade
  34. // @description:cs Přesměrování platforem sociálních médií na jejich titulní stránky šetrné k soukromí
  35. // @description:de Leitet von Social-Media-Plattformen auf deren jeweilige datenschutzfreundlicheren Frontends
  36. // @description:da Omdirigering af sociale medieplatforme til deres privatlivsvenlige forsider
  37. // @description:et Sotsiaalmeediaplatvormide ümbersuunamine nende privaatsussõbralikele esilehtedele
  38. // @description:es Redirigir las plataformas de medios sociales a sus portadas respetuosas con la privacidad
  39. // @description:fi Sosiaalisen median alustojen ohjaaminen yksityisyyden suojaa edistäville etusivuille.
  40. // @description:fr Rediriger les plateformes de médias sociaux vers leurs pages d'accueil respectueuses de la vie privée
  41. // @description:el Αναπροσανατολισμός των πλατφορμών κοινωνικής δικτύωσης στις μπροστινές σελίδες τους που είναι φιλικές προς το απόρρητο
  42. // @description:hu A közösségi médiaplatformok átirányítása az adatvédelem-barát kezdőlapokra
  43. // @description:id Mengarahkan platform media sosial ke halaman depan yang ramah privasi
  44. // @description:it Reindirizzare le piattaforme di social media verso le loro pagine frontali che rispettano la privacy
  45. // @description:ja ソーシャルメディアプラットフォームをプライバシーに配慮したフロントページにリダイレクトする
  46. // @description:lt Socialinės žiniasklaidos platformų nukreipimas į privatumą užtikrinančius pirmuosius puslapius
  47. // @description:lv Sociālo plašsaziņas līdzekļu platformu pāradresēšana uz to privātumam draudzīgajām pirmajām lapām.
  48. // @description:nl Sociale-mediaplatforms omleiden naar hun privacyvriendelijke voorpagina's
  49. // @description:pl Przekierowanie platform mediów społecznościowych na ich przyjazne dla prywatności strony tytułowe
  50. // @description:pt Redireccionar as plataformas de redes sociais para as suas primeiras páginas amigas da privacidade
  51. // @description:ro Redirecționarea platformelor de socializare către paginile lor de început care respectă viața privată
  52. // @description:ru Перенаправление платформ социальных сетей на их главные страницы, дружественные к конфиденциальности
  53. // @description:sv Omdirigera sociala medieplattformar till deras integritetsvänliga förstasidor.
  54. // @description:sl preusmeritev platform družabnih medijev na njihove naslovne strani, ki so prijazne do zasebnosti.
  55. // @description:sk Presmerovanie platforiem sociálnych médií na ich úvodné stránky, ktoré chránia súkromie
  56. // @description:tr Sosyal medya platformlarını, gizliliğe saygı duyan önyüzlerine yönlendirir
  57. // @description:uk Перенаправлення соціальних медіа-платформ на їхні головні сторінки, дружні до приватності
  58. // @description:zh 将社交媒体平台重定向到其隐私友好的首页
  59. // @description:zh-CN 将社交媒体平台重定向到其隐私友好的首页
  60. // @namespace https://github.com/dybdeskarphet/privacy-redirector
  61. // @author Ahmet Arda Kavakcı
  62. // @license GPLv3
  63. // @version 1.3.3
  64. // @supportURL https://github.com/dybdeskarphet/privacy-redirector
  65. // @run-at document-start
  66. // @match *://*.fandom.com/*
  67. // @match *://*.imdb.com/*
  68. // @match *://*.imgur.com/*
  69. // @match *://*.instagram.com/*
  70. // @match *://*.medium.com/*
  71. // @match *://*.quora.com/*
  72. // @match *://*.reddit.com/*
  73. // @match *://*.reuters.com/*
  74. // @match *://*.tiktok.com/*
  75. // @match *://*.twitter.com/*
  76. // @match *://*.wikipedia.org/*
  77. // @match *://*.youtube.com/*
  78. // @match *://imgur.com/*
  79. // @match *://instagram.com/*
  80. // @match *://medium.com/*
  81. // @match *://news.ycombinator.com/*
  82. // @match *://reddit.com/*
  83. // @match *://translate.google.com/*
  84. // @match *://twitter.com/*
  85. // @match *://youtube.com/*
  86. // ==/UserScript==
  87.  
  88. /*
  89. ___ _ _ ___ _____ _____
  90. / _ \| \ | | / _ \| ___| ___|
  91. | | | | \| |_____| | | | |_ | |_
  92. | |_| | |\ |_____| |_| | _| | _|
  93. \___/|_| \_| \___/|_| |_|
  94.  
  95. CHANGE THE RELEVANT VALUE TO "false" TO
  96. DISABLE THE REDIRECTION/FARSIDE FOR THAT
  97. PARTICULAR PLATFORM */
  98.  
  99. // REDIRECTON / FARSIDE
  100. let fandom = [true, true];
  101. let gtranslate = [true, true];
  102. let hackernews = [true, true];
  103. let imdb = [true, true];
  104. let imgur = [true, true];
  105. let instagram = [false, true];
  106. let medium = [true, true];
  107. let quora = [true, true];
  108. let reddit = [true, true];
  109. let reuters = [true, true];
  110. let tiktok = [true, true];
  111. let twitter = [true, true];
  112. let wikipedia = [true, true];
  113. let youtube = [true, true];
  114.  
  115. // // // // // // // // // // // // //
  116.  
  117. /*
  118. ___ _
  119. |_ _|_ __ ___| |_ __ _ _ __ ___ ___ ___
  120. | || '_ \/ __| __/ _` | '_ \ / __/ _ \/ __|
  121. | || | | \__ \ || (_| | | | | (_| __/\__ \
  122. |___|_| |_|___/\__\__,_|_| |_|\___\___||___/
  123.  
  124. LIST OF INSTANCES TO USE IF FARSIDE IS NOT ENABLED
  125. */
  126.  
  127. let bibliogramInstances = [
  128. "bibliogram.1d4.us",
  129. "ig.tokhmi.xyz"
  130. ];
  131.  
  132. let breezewikiInstances = [
  133. "breezewiki.com",
  134. "breezewiki.pussthecat.org",
  135. "breezewiki.esmailelbob.xyz",
  136. "bw.vern.cc",
  137. ];
  138.  
  139. let invidiousInstances = [
  140. "invidious.snopyta.org",
  141. "yewtu.be",
  142. "vid.puffyan.us",
  143. "invidious.namazso.eu",
  144. ];
  145.  
  146. let libredditInstances = [
  147. "libreddit.spike.codes",
  148. "libreddit.org",
  149. "libreddit.kavin.rocks",
  150. "reddit.invak.id",
  151. ];
  152.  
  153. let libremdbInstances = [
  154. "libremdb.iket.me",
  155. "libremdb.pussthecat.org",
  156. "libremdbeu.herokuapp.com",
  157. "lmdb.tokhmi.xyz",
  158. ];
  159.  
  160. let lingvaInstances = [
  161. "lingva.ml",
  162. "translate.igna.wtf",
  163. "translate.plausibility.cloud",
  164. "translate.projectsegfau.lt",
  165. ];
  166.  
  167. let nitterInstances = [
  168. "nitter.net",
  169. "nitter.pussthecat.org",
  170. "nitter.fdn.fr",
  171. "nitter.1d4.us",
  172. ];
  173.  
  174. let proxitokInstances = [
  175. "proxitok.pabloferreiro.es",
  176. "proxitok.pussthecat.org",
  177. "tok.habedieeh.re",
  178. "proxitok.esmailelbob.xyz",
  179. ];
  180.  
  181. let quetreInstances = [
  182. "quetre.iket.me",
  183. "quora.vern.cc",
  184. "quetre.pussthecat.org",
  185. "quetre.tokhmi.xyz",
  186. ];
  187.  
  188. let rimgoInstances = [
  189. "i.bcow.xyz",
  190. "rimgo.pussthecat.org",
  191. "rimgo.totaldarkness.net",
  192. "rimgo.bus-hit.me",
  193. ];
  194.  
  195. let scribeInstances = [
  196. "scribe.rip",
  197. "scribe.nixnet.services",
  198. "scribe.citizen4.eu",
  199. "scribe.bus-hit.me",
  200. ];
  201.  
  202. let tedditInstances = [
  203. "teddit.pussthecat.org",
  204. "teddit.ggc-project.de",
  205. "teddit.domain.glass",
  206. "teddit.zaggy.nl",
  207. ];
  208.  
  209. let wikilessInstances = [
  210. "wikiless.org",
  211. "wikiless.sethforprivacy.com",
  212. "wiki.604kph.xyz",
  213. "wikiless.lunar.icu",
  214. ];
  215.  
  216. let farsideInstance = "farside.link";
  217.  
  218. // // // // // // // // // // // // //
  219.  
  220. var debug_mode = false;
  221.  
  222. if (debug_mode == true) {
  223. alert(
  224. "Hostname: " +
  225. window.location.hostname +
  226. "\nPath: " +
  227. window.location.pathname +
  228. "\nQuery: " +
  229. window.location.search +
  230. "\nHash: " +
  231. window.location.hash
  232. );
  233. }
  234.  
  235. function redirectInstagram() {
  236. if (instagram[0] == false) {
  237. return;
  238. }
  239.  
  240. window.stop();
  241.  
  242. alert("Bibliogram is discontinued, you may want to disable the redirection.");
  243.  
  244. var selectedInstance = "";
  245.  
  246. if (instagram[1] == false) {
  247. selectedInstance =
  248. bibliogramInstances[
  249. Math.floor(Math.random() * bibliogramInstances.length)
  250. ];
  251. } else {
  252. selectedInstance = farsideInstance + "/bibliogram";
  253. }
  254.  
  255. if (window.location.pathname.startsWith("/accounts/login/")) {
  256. if (window.location.search.indexOf("/reel/") != -1) {
  257. // reels
  258. let newURL =
  259. window.location.protocol +
  260. "//" +
  261. selectedInstance +
  262. window.location.pathname.replace("/accounts/login/", "/") +
  263. window.location.search.replace("?next=/reel", "p") +
  264. window.location.hash;
  265.  
  266. window.location.replace(newURL);
  267. } else if (window.location.search.indexOf("/p/") == -1) {
  268. // user pages - it will crash if it's not the second last block
  269. let newURL =
  270. window.location.protocol +
  271. "//" +
  272. selectedInstance +
  273. window.location.pathname.replace("/accounts/login/", "/") +
  274. window.location.search.replace("?next=", "u") +
  275. window.location.hash;
  276.  
  277. window.location.replace(newURL);
  278. } else {
  279. // probably a post
  280. let newURL =
  281. window.location.protocol +
  282. "//" +
  283. selectedInstance +
  284. window.location.pathname.replace("/accounts/login/", "") +
  285. window.location.search.replace("?next=", "") +
  286. window.location.hash;
  287.  
  288. window.location.replace(newURL);
  289. }
  290. } else {
  291. if (window.location.pathname == "/") {
  292. // home page
  293. location.hostname = selectedInstance;
  294. } else if (window.location.pathname.startsWith("/reel/")) {
  295. // reel
  296. let newURL =
  297. window.location.protocol +
  298. "//" +
  299. selectedInstance +
  300. window.location.pathname.replace("/reel", "/p") +
  301. window.location.hash;
  302.  
  303. window.location.replace(newURL);
  304. } else if (!window.location.pathname.startsWith("/p/")) {
  305. // user page - it will crash if it's not the second last block
  306. let newURL =
  307. window.location.protocol +
  308. "//" +
  309. selectedInstance +
  310. "/u" +
  311. window.location.pathname +
  312. window.location.search +
  313. indow.location.hash;
  314.  
  315. window.location.replace(newURL);
  316. } else {
  317. // probably a post
  318. location.hostname = selectedInstance;
  319. }
  320. }
  321. }
  322.  
  323. function redirectTwitter() {
  324. if (twitter[0] == false) {
  325. return;
  326. }
  327.  
  328. window.stop();
  329.  
  330. var selectedInstance = "";
  331.  
  332. if (twitter[1] == false) {
  333. selectedInstance =
  334. nitterInstances[Math.floor(Math.random() * nitterInstances.length)];
  335. } else {
  336. selectedInstance = farsideInstance + "/nitter";
  337. }
  338.  
  339. let newURL =
  340. window.location.protocol +
  341. "//" +
  342. selectedInstance +
  343. window.location.pathname +
  344. window.location.search +
  345. window.location.hash;
  346.  
  347. window.location.replace(newURL);
  348. }
  349.  
  350. function redirectReddit() {
  351. if (reddit[0] == false) {
  352. return;
  353. }
  354.  
  355. window.stop();
  356.  
  357. var selectedTeddit = "";
  358. var selectedLibreddit = "";
  359.  
  360. if (reddit[1] == false) {
  361. selectedTeddit =
  362. tedditInstances[Math.floor(Math.random() * tedditInstances.length)];
  363. selectedLibreddit =
  364. libredditInstances[Math.floor(Math.random() * libredditInstances.length)];
  365. } else {
  366. selectedTeddit = farsideInstance + "/teddit";
  367. selectedLibreddit = farsideInstance + "/libreddit";
  368. }
  369.  
  370. if (window.location.hostname == "old.reddit.com") {
  371. let newURL =
  372. window.location.protocol +
  373. "//" +
  374. selectedTeddit +
  375. window.location.pathname +
  376. window.location.search +
  377. window.location.hash;
  378.  
  379. window.location.replace(newURL);
  380. } else {
  381. let newURL =
  382. window.location.protocol +
  383. "//" +
  384. selectedLibreddit +
  385. window.location.pathname +
  386. window.location.search +
  387. window.location.hash;
  388.  
  389. window.location.replace(newURL);
  390. }
  391. }
  392.  
  393. function redirectYoutube() {
  394. if (youtube[0] == false) {
  395. return;
  396. }
  397.  
  398. window.stop();
  399.  
  400. var selectedInstance = "";
  401.  
  402. if (youtube[1] == false) {
  403. selectedInstance =
  404. invidiousInstances[Math.floor(Math.random() * invidiousInstances.length)];
  405. } else {
  406. selectedInstance = farsideInstance + "/invidious";
  407. }
  408.  
  409. let newURL =
  410. window.location.protocol +
  411. "//" +
  412. selectedInstance +
  413. window.location.pathname +
  414. window.location.search +
  415. window.location.hash;
  416.  
  417. window.location.replace(newURL);
  418. }
  419.  
  420. function redirectTiktok() {
  421. if (tiktok[0] == false) {
  422. return;
  423. }
  424.  
  425. window.stop();
  426.  
  427. var selectedInstance = "";
  428.  
  429. if (tiktok[1] == false) {
  430. selectedInstance =
  431. proxitokInstances[Math.floor(Math.random() * proxitokInstances.length)];
  432. } else {
  433. selectedInstance = farsideInstance + "/proxitok";
  434. }
  435.  
  436. if (window.location.pathname.startsWith("/discover")) {
  437. let newURL =
  438. window.location.protocol +
  439. "//" +
  440. selectedInstance +
  441. window.location.pathname.replace("discover", "tag") +
  442. window.location.hash;
  443.  
  444. window.location.replace(newURL);
  445. } else if (window.location.pathname.search(/[a-z][a-z]\-[A-Z][A-Z]/g) != -1) {
  446. let newURL =
  447. window.location.protocol +
  448. "//" +
  449. selectedInstance +
  450. window.location.pathname +
  451. window.location.search +
  452. window.location.hash;
  453.  
  454. window.location.replace(newURL);
  455. } else {
  456. let newURL =
  457. window.location.protocol +
  458. "//" +
  459. selectedInstance +
  460. window.location.pathname +
  461. window.location.search +
  462. window.location.hash;
  463.  
  464. window.location.replace(newURL);
  465. }
  466. }
  467.  
  468. function redirectImgur() {
  469. if (imgur[0] == false) {
  470. return;
  471. }
  472.  
  473. window.stop();
  474.  
  475. var selectedInstance = "";
  476.  
  477. if (imgur[1] == false) {
  478. selectedInstance =
  479. rimgoInstances[Math.floor(Math.random() * rimgoInstances.length)];
  480. } else {
  481. selectedInstance = farsideInstance + "/rimgo";
  482. }
  483.  
  484. let newURL =
  485. window.location.protocol +
  486. "//" +
  487. selectedInstance +
  488. window.location.pathname +
  489. window.location.search +
  490. window.location.hash;
  491.  
  492. window.location.replace(newURL);
  493. }
  494.  
  495. function redirectMedium() {
  496. if (medium[0] == false || window.location.pathname == "/") {
  497. return;
  498. }
  499.  
  500. window.stop();
  501.  
  502. var selectedInstance = "";
  503.  
  504. if (medium[1] == false) {
  505. selectedInstance =
  506. scribeInstances[Math.floor(Math.random() * scribeInstances.length)];
  507. } else {
  508. selectedInstance = farsideInstance + "/scribe";
  509. }
  510.  
  511. let newURL =
  512. window.location.protocol +
  513. "//" +
  514. selectedInstance +
  515. window.location.pathname +
  516. window.location.search +
  517. window.location.hash;
  518.  
  519. window.location.replace(newURL);
  520. }
  521.  
  522. function redirectYoutubeMusic() {
  523. if (youtube[0] == false) {
  524. return;
  525. }
  526.  
  527. window.stop();
  528.  
  529. if (window.location.pathname.startsWith("/playlist")) {
  530. let newURL =
  531. window.location.protocol +
  532. "//" +
  533. "beatbump.ml" +
  534. window.location.pathname +
  535. window.location.search.replace("?list=", "/VL") +
  536. window.location.hash;
  537.  
  538. window.location.replace(newURL);
  539. } else if (window.location.pathname.startsWith("/channel")) {
  540. let newURL =
  541. window.location.protocol +
  542. "//" +
  543. "beatbump.ml" +
  544. window.location.pathname.replace("/channel", "/artist") +
  545. window.location.search +
  546. window.location.hash;
  547.  
  548. window.location.replace(newURL);
  549. } else if (window.location.pathname.startsWith("/explore")) {
  550. let newURL =
  551. window.location.protocol +
  552. "//" +
  553. "beatbump.ml" +
  554. window.location.pathname.replace("/explore", "/trending") +
  555. window.location.search +
  556. window.location.hash;
  557.  
  558. window.location.replace(newURL);
  559. } else if (window.location.pathname.startsWith("/moods_and_genres")) {
  560. let newURL =
  561. window.location.protocol +
  562. "//" +
  563. "beatbump.ml" +
  564. window.location.pathname.replace("/moods_and_genres", "/explore") +
  565. window.location.search +
  566. window.location.hash;
  567.  
  568. window.location.replace(newURL);
  569. } else {
  570. location.hostname = "beatbump.ml";
  571. }
  572. }
  573.  
  574. function redirectHackerNews() {
  575. if (hackernews[0] == false) {
  576. return;
  577. }
  578.  
  579. window.stop();
  580. let newURL = window.location.protocol + "//" + "hn.algolia.com";
  581. window.location.replace(newURL);
  582. }
  583.  
  584. function redirectGTranslate() {
  585. if (gtranslate[0] == false) {
  586. return;
  587. }
  588.  
  589. window.stop();
  590.  
  591. var selectedInstance = "";
  592.  
  593. if (gtranslate[1] == false) {
  594. selectedInstance =
  595. lingvaInstances[Math.floor(Math.random() * lingvaInstances.length)];
  596. } else {
  597. selectedInstance = farsideInstance + "/lingva";
  598. }
  599.  
  600. if (window.location.search != "") {
  601. let newURL =
  602. window.location.protocol +
  603. "//" +
  604. selectedInstance +
  605. window.location.pathname +
  606. window.location.search
  607. .replace(/\?hl=tr/, "")
  608. .replace(/.sl=/, "")
  609. .replace("&tl=", "/")
  610. .replace("&text=", "/")
  611. .replace("&op=translate", "") +
  612. window.location.hash;
  613.  
  614. window.location.replace(newURL);
  615. } else {
  616. let newURL = window.location.protocol + "//" + selectedInstance;
  617. window.location.replace(newURL);
  618. }
  619. }
  620.  
  621. function redirectReuters() {
  622. if (reuters[0] == false) {
  623. return;
  624. }
  625.  
  626. window.stop();
  627. location.hostname = "neuters.de";
  628. }
  629.  
  630. function redirectWikipedia() {
  631. if (wikipedia[0] == false) {
  632. return;
  633. }
  634.  
  635. window.stop();
  636.  
  637. let langCodeIndex = window.location.hostname.search(/^[a-z][a-z]\./);
  638. var selectedInstance = "";
  639.  
  640. if (wikipedia[1] == false) {
  641. selectedInstance =
  642. wikilessInstances[Math.floor(Math.random() * wikilessInstances.length)];
  643. } else {
  644. selectedInstance = farsideInstance + "/wikiless";
  645. }
  646.  
  647. if (langCodeIndex != -1) {
  648. let newURL =
  649. window.location.protocol +
  650. "//" +
  651. selectedInstance +
  652. window.location.pathname +
  653. "?lang=" +
  654. window.location.hostname[langCodeIndex] +
  655. window.location.hostname[langCodeIndex + 1] +
  656. window.location.hash;
  657. window.location.replace(newURL);
  658. } else {
  659. let newURL =
  660. window.location.protocol +
  661. "//" +
  662. selectedInstance +
  663. window.location.pathname +
  664. "?lang=en" +
  665. window.location.hash;
  666. window.location.replace(newURL);
  667. }
  668. }
  669.  
  670. function redirectImdb() {
  671. if (imdb[0] == false) {
  672. return;
  673. }
  674.  
  675. if (window.location.pathname.startsWith("/title/")) {
  676. window.stop();
  677.  
  678. var selectedInstance = "";
  679.  
  680. if (imdb[1] == false) {
  681. selectedInstance =
  682. libremdbInstances[Math.floor(Math.random() * libremdbInstances.length)];
  683. } else {
  684. selectedInstance = farsideInstance + "/libremdb";
  685. }
  686.  
  687. let newURL =
  688. window.location.protocol +
  689. "//" +
  690. selectedInstance +
  691. window.location.pathname +
  692. window.location.search +
  693. window.location.hash;
  694. window.location.replace(newURL);
  695. }
  696. }
  697.  
  698. function redirectQuora() {
  699. if (quora[0] == false) {
  700. return;
  701. }
  702.  
  703. window.stop();
  704.  
  705. var selectedInstance = "";
  706.  
  707. if (quora[1] == false) {
  708. selectedInstance =
  709. quetreInstances[Math.floor(Math.random() * quetreInstances.length)];
  710. } else {
  711. selectedInstance = farsideInstance + "/quetre";
  712. }
  713.  
  714. let newURL =
  715. window.location.protocol +
  716. "//" +
  717. selectedInstance +
  718. window.location.pathname +
  719. window.location.search +
  720. window.location.hash;
  721.  
  722. window.location.replace(newURL);
  723. }
  724.  
  725. function redirectFandom() {
  726. if (fandom[0] == false) {
  727. return;
  728. }
  729.  
  730. let randomInstance =
  731. breezewikiInstances[Math.floor(Math.random() * breezewikiInstances.length)];
  732. let fandomName = window.location.hostname.replace(/\..*/, "");
  733. let newURL = "";
  734.  
  735. window.stop();
  736.  
  737. if (fandomName !== "www") {
  738. newURL =
  739. window.location.protocol +
  740. "//" +
  741. randomInstance +
  742. `/${fandomName}` +
  743. window.location.pathname +
  744. window.location.search +
  745. window.location.hash;
  746. } else {
  747. newURL = window.location.protocol + "//" + randomInstance;
  748. }
  749.  
  750. window.location.replace(newURL);
  751. }
  752.  
  753. let urlHostname = window.location.hostname;
  754.  
  755. switch (urlHostname) {
  756. case "www.instagram.com":
  757. redirectInstagram();
  758. break;
  759.  
  760. case "twitter.com":
  761. case "mobile.twitter.com":
  762. redirectTwitter();
  763. break;
  764.  
  765. case "www.reddit.com":
  766. case "old.reddit.com":
  767. redirectReddit();
  768. break;
  769.  
  770. case "www.youtube.com":
  771. case "m.youtube.com":
  772. redirectYoutube();
  773. break;
  774.  
  775. case "www.tiktok.com":
  776. redirectTiktok();
  777. break;
  778.  
  779. case "music.youtube.com":
  780. redirectYoutubeMusic();
  781. break;
  782.  
  783. case "news.ycombinator.com":
  784. redirectHackerNews();
  785. break;
  786.  
  787. case "translate.google.com":
  788. redirectGTranslate();
  789. break;
  790.  
  791. case "www.reuters.com":
  792. redirectReuters();
  793. break;
  794.  
  795. case "www.imdb.com":
  796. redirectImdb();
  797. break;
  798.  
  799. case "www.quora.com":
  800. redirectQuora();
  801. break;
  802. }
  803.  
  804. if (urlHostname.includes("medium.com")) {
  805. redirectMedium();
  806. } else if (urlHostname.includes("imgur.com")) {
  807. redirectImgur();
  808. } else if (urlHostname.includes("wikipedia.org")) {
  809. redirectWikipedia();
  810. } else if (urlHostname.includes("fandom.com")) {
  811. redirectFandom();
  812. }