Paywall Bypass Script (12ft.io, Google Cache, PaywallBuster.com)

Mobile and desktop-friendly paywall bypass with dropdown menu and right-click options. Added Mobile + Desktop support.

目前为 2024-10-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Paywall Bypass Script (12ft.io, Google Cache, PaywallBuster.com)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2.1
  5. // @description Mobile and desktop-friendly paywall bypass with dropdown menu and right-click options. Added Mobile + Desktop support.
  6. // @author sharmanhall
  7. // @license MIT
  8. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABIUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKuErJsAAAAXdFJOUwAQIDBAUF9gb3B/gI+Qn6CvsL/P0N/vIiFUiwAABbVJREFUeJztW9m2mzAMNNvlkhR64xT0/3/ac0wIXmZABtqnzFvAWLakkeQl5oMPPvjggw8++OBilFXTtm3b1nVp/jeKtn9O4uH509XmWtT9JALfVLenIExDY66Cky7yTN8UrRWO8fsKa7yki8gjflXcJtnGeDPnsEoXkXv0st0TLyIynnCGQLqIhDYtt5Tv46ASYukiUvnvvzXTn/FTmFwA6RKQoPiRDDzzRoClByQoR8lCxgiY9IAEufJFBqPChnSfBPnyRTqzi23pHgmOyJdpJyTtSl9JUByRv20EjfSVBL/kGCqDoZT+JkErB9Fj+TiTIcwkKPXxJ8KEqShqzCT4zRs8h2GwGw4Ck0IlajgSUANM99cEa6pTaING1HBOxCboh/s7aTOiAfSihtlQQJioWZ5ATqBNqS8SEPVGhUJBHBXFojwS1PhVotsHbgdqxELUuHMKJDMjlmrTAZApITTUBVPvLgUCDKATNSo63NS0RLFgAHkkwK1RlhEIMABEAvsHffyklEEBTiCAE8Z8mfqmwD78AK0dUHghJqi3G062mzMmpOadhe2HSUECfJqQV68a+/odp+DHDfNBVGuRAJ82nEkw2c53ZDz8irEbuQCOF2Bp2YdTn4GHb4zpRgBYcON4Aehy70rwEH0MRs9B4oV2tU5JoAaJ2NrFCSOBGiQQW6MD5nDOZgdRQGt0wAZkNTUAUQCshxBwfjJ6kBrnl1ECZpwMEnwLhnq3CE5ATwK2btB78XTqc7ZwHNUKOEkCtnDUUuAsCW6CoY0BZ0nA5E8Z+5VnSPAlBIrtkTdOkIDKV24QzThOAip/zNmkw9WIhgRUfo4DsGpEQQIqPyuPsaX1/ndcfk4iZ9XIPgmI/NEOOQQwrBrZJQHiv1ti5EMQ9rQI5I/tEekHSZDKn3IV/8YREgxJ+/H4SREkwbT1RZHK/1O8X1buIDGjnoMk2EplRbqUXuQXtzWsqyuqXBKUqfyX/sMDtU0lesDVCPcotHFfojdaDeBqhJ67IfkzZasop2kLElyNMB+qgPw58yUj0yZkWI0w+1Uoc8+1XzIybUKA1QhR3xesHJwHpBsJzo2+hzdYmIR9YhLg9DO3TU3jYqlHMYORQQJSfjoLBAqwXVVWjVPM+pCRQk8CVv46f/Wjmbce8PIMiyxqEiD5bds281jJeXuDH/vQkmAAzVatejMNluRe7yy96khQDNvNvJkGqvZ6Z5FFRYIC7uR6Wu3Qw6B3GllgzxEJSizf0ypRtUcxFphxNRKSgJ4bO6321lrr6fFprbX2x9ystV4UmNzjlF24JA/sxc+t3Wu8OWFxlk8dAVYjgb0qKt+RgGyS97jUNQngOH17VfzY1rkb2SHtoHMBR4BfeyT42pHPDoBq6FxpNNwjAV99LXQjB0AFdK40xeyQgIV/j+54h3DCzpVLAoX8PBKkJcEmCTbk/9S1V/mzeOOZh9WYWySA4d/D6lE1ehiah5RDmMTzqeiefJwJAjdbzZNXjbhO9k+Y16Dv7dX7qlZkgo0jqf0T5tUHiKq9LshlFkJi14nuhHn21zjpvszjdZFVjcyd6E6YnWqr9HdjdCSAJJ7tpbtm4VY/XjTrX78rc5oEumsWzl/v6e9oegdIoLxr5FT7SH7HiTqvJHedKO8aOdU+k99OoDe9rJJ87kR312hx+gWuJC8uIQG7mBQCkqBOSZBVks8kIJdyIixOH/xuX1b0pkfkYzvPJNCxMCbBMnNnxXMk0F3gi0nwor+WBNjOrlPlZaeYBK+xL66wgJEA29l1qrvstDj9gmXmiyssyNy9zwSrRjz9slx4Ddi61BvA1FZlmbF3mwe2BRCH2YxzzDywLYA4lmad4+XAI2zwPCbSv/LEmAQrolh2+DxjB4wECZWv+/tNCFaSJ4Hu6v8gLdgq/IIRXPHnH4TNwq9cL/tqjy+uRtnc+2G4t/8sDH2Qi78rE2kubw+WUAAAAABJRU5ErkJggg==
  9. // @match *://*.adelaidenow.com.au/*
  10. // @match *://*.adweek.com/*
  11. // @match *://*.afr.com/*
  12. // @match *://*.ambito/*
  13. // @match *://*.ampproject.org/*
  14. // @match *://*.baltimoresun.com/*
  15. // @match *://*.barrons.com/*
  16. // @match *://*.bizjournals.com/*
  17. // @match *://*.bloomberg.com/*
  18. // @match *://*.bloombergquint.com/*
  19. // @match *://*.bostonglobe.com/*
  20. // @match *://*.brisbanetimes.com.au/*
  21. // @match *://*.britannica.com/*
  22. // @match *://*.businessinsider.com/*
  23. // @match *://*.caixinglobal.com/*
  24. // @match *://*.cen.acs.org/*
  25. // @match *://*.centralwesterndaily.com.au/*
  26. // @match *://*.chicagobusiness.com/*
  27. // @match *://*.chicagotribune.com/*
  28. // @match *://*.corriere.it/*
  29. // @match *://*.courant.com/*
  30. // @match *://*.couriermail.com.au/*
  31. // @match *://*.dailypress.com/*
  32. // @match *://*.dailytelegraph.com.au/*
  33. // @match *://*.delfi.ee/*
  34. // @match *://*.demorgen.be/*
  35. // @match *://*.denverpost.com/*
  36. // @match *://*.df.cl/*
  37. // @match *://*.dynamed.com/*
  38. // @match *://*.economist.com/*
  39. // @match *://*.elmercurio.com/*
  40. // @match *://*.elmundo.es/*
  41. // @match *://*.elu24.ee/*
  42. // @match *://*.entreprenal.com/*
  43. // @match *://*.examiner.com.au/*
  44. // @match *://*.expansion.com/*
  45. // @match *://*.fd.nl/*
  46. // @match *://*.financialpost.com/*
  47. // @match *://*.fnlondon.com/*
  48. // @match *://*.foreignpolicy.com/*
  49. // @match *://*.fortune.com/*
  50. // @match *://*.ft.com/*
  51. // @match *://*.gelocal.it/*
  52. // @match *://*.genomeweb.com/*
  53. // @match *://*.glassdoor.com/*
  54. // @match *://*.globes.co.il/*
  55. // @match *://*.groene.nl/*
  56. // @match *://*.haaretz.co.il/*
  57. // @match *://*.haaretz.com/*
  58. // @match *://*.harpers.org/*
  59. // @match *://*.hbr.org/*
  60. // @match *://*.hbrchina.org/*
  61. // @match *://*.heraldsun.com.au/*
  62. // @match *://*.historyextra.com/*
  63. // @match *://*.humo.be/*
  64. // @match *://*.ilmanifesto.it/*
  65. // @match *://*.inc.com/*
  66. // @match *://*.inquirer.com/*
  67. // @match *://*.interest.co.nz/*
  68. // @match *://*.investorschronicle.co.uk/*
  69. // @match *://*.irishtimes.com/*
  70. // @match *://*.japantimes.co.jp/*
  71. // @match *://*.journalnow.com/*
  72. // @match *://*.kansascity.com/*
  73. // @match *://*.labusinessjournal.com/*
  74. // @match *://*.lanacion.com.ar/*
  75. // @match *://*.lastampa.it/*
  76. // @match *://*.latercera.com/*
  77. // @match *://*.latimes.com/*
  78. // @match *://*.lavoixdunord.fr/*
  79. // @match *://*.lecho.be/*
  80. // @match *://*.leparisien.fr/*
  81. // @match *://*.lesechos.fr/*
  82. // @match *://*.loebclassics.com/*
  83. // @match *://*.lrb.co.uk/*
  84. // @match *://*.mcall.com/*
  85. // @match *://*.medium.com/*
  86. // @match *://*.medscape.com/*
  87. // @match *://*.mercurynews.com/*
  88. // @match *://*.mv-voice.com/*
  89. // @match *://*.nationalpost.com/*
  90. // @match *://*.netdna-ssl.com/*
  91. // @match *://*.news-gazette.com/*
  92. // @match *://*.newstatesman.com/*
  93. // @match *://*.newyorker.com/*
  94. // @match *://*.nrc.nl/*
  95. // @match *://*.ntnews.com.au/*
  96. // @match *://*.nydailynews.com/*
  97. // @match *://*.nymag.com/*
  98. // @match *://*.nytimes.com/*
  99. // @match *://*.nzherald.co.nz/*
  100. // @match *://*.nzz.ch/*
  101. // @match *://*.ocregister.com/*
  102. // @match *://*.orlandosentinel.com/*
  103. // @match *://*.outbrain.com/*
  104. // @match *://*.paloaltoonline.com/*
  105. // @match *://*.parool.nl/*
  106. // @match *://*.piano.io/*
  107. // @match *://*.poool.fr/*
  108. // @match *://*.postimees.ee/*
  109. // @match *://*.qiota.com/*
  110. // @match *://*.qz.com/*
  111. // @match *://*.repubblica.it/*
  112. // @match *://*.republic.ru/*
  113. // @match *://*.reuters.com/*
  114. // @match *://*.sandiegouniontribune.com/*
  115. // @match *://*.scientificamerican.com/*
  116. // @match *://*.scmp.com/*
  117. // @match *://*.seattletimes.com/*
  118. // @match *://*.seekingalpha.com/*
  119. // @match *://*.slate.com/*
  120. // @match *://*.smh.com.au/*
  121. // @match *://*.sofrep.com/*
  122. // @match *://*.spectator.co.uk/*
  123. // @match *://*.spectator.com.au/*
  124. // @match *://*.spectator.us/*
  125. // @match *://*.speld.nl/*
  126. // @match *://*.startribune.com/*
  127. // @match *://*.statista.com/*
  128. // @match *://*.stuff.co.nz/*
  129. // @match *://*.sueddeutsche.de/*
  130. // @match *://*.sun-sentinel.com/*
  131. // @match *://*.techinasia.com/*
  132. // @match *://*.technologyreview.com/*
  133. // @match *://*.telegraaf.nl/*
  134. // @match *://*.telegraph.co.uk/*
  135. // @match *://*.the-tls.co.uk/*
  136. // @match *://*.theadvocate.com.au/*
  137. // @match *://*.theage.com.au/*
  138. // @match *://*.theathletic.co.uk/*
  139. // @match *://*.theathletic.com/*
  140. // @match *://*.theatlantic.com/*
  141. // @match *://*.theaustralian.com.au/*
  142. // @match *://*.thediplomat.com/*
  143. // @match *://*.theglobeandmail.com/*
  144. // @match *://*.theherald.com.au/*
  145. // @match *://*.thehindu.com/*
  146. // @match *://*.themarker.com/*
  147. // @match *://*.themercury.com.au/*
  148. // @match *://*.thenation.com/*
  149. // @match *://*.thenational.scot/*
  150. // @match *://*.theolivepress.es/*
  151. // @match *://*.thesaturdaypaper.com.au/*
  152. // @match *://*.thestar.com/*
  153. // @match *://*.thewrap.com/*
  154. // @match *://*.tijd.be/*
  155. // @match *://*.time.com/*
  156. // @match *://*.tinypass.com/*
  157. // @match *://*.towardsdatascience.com/*
  158. // @match *://*.trouw.nl/*
  159. // @match *://*.vanityfair.com/*
  160. // @match *://*.vn.nl/*
  161. // @match *://*.volkskrant.nl/*
  162. // @match *://*.washingtonpost.com/*
  163. // @match *://*.wired.com/*
  164. // @match *://*.wsj.com/*
  165. // @match *://*.zeit.de/*
  166. // @grant GM_registerMenuCommand
  167. // @grant GM_addStyle
  168. // @grant GM_addElement
  169. // ==/UserScript==
  170.  
  171. (function() {
  172. 'use strict';
  173.  
  174. // Constants
  175. const _12FT_PREFIX = "https://12ft.io/proxy?ref=pro&q=";
  176. const _12FT_ORIGIN = new URL(_12FT_PREFIX).origin;
  177. const PAYWALLBUSTER_PREFIX = "https://paywallbuster.com/q/";
  178. const PAYWALLBUSTER_ORIGIN = new URL(PAYWALLBUSTER_PREFIX).origin;
  179.  
  180. // Add right-click menu options
  181. GM_registerMenuCommand("Bypass with 12ft", () => bypassPage());
  182. GM_registerMenuCommand("Bypass with PaywallBuster", () => bypassWithPaywallBuster());
  183. GM_registerMenuCommand("Archive Today", () => archivePage('https://archive.today/newest/'));
  184. GM_registerMenuCommand("Archive Is", () => archivePage('https://archive.is/newest/'));
  185. GM_registerMenuCommand("Archive Ph", () => archivePage('https://archive.ph/newest/'));
  186. GM_registerMenuCommand("Remove Paywall", () => archivePage('https://removepaywall.com/search?url='));
  187. GM_registerMenuCommand("Google Cache", () => archivePage('https://webcache.googleusercontent.com/search?q=cache:'));
  188. GM_registerMenuCommand("Yandex Cache", () => archivePage('https://www.yandex.ru/search/?site='));
  189. //GM_registerMenuCommand("Cached View -- Broken", () => archivePage('https://cachedview.foundtt.com/'));
  190. GM_registerMenuCommand("Yahoo Cache", () => archivePage('https://search.yahoo.com/search?p='));
  191. GM_registerMenuCommand("Bing Cache", () => archivePage('https://www.bing.com/search?q=url:'));
  192. GM_registerMenuCommand("Similar Web", () => archivePage('https://www.similarweb.com/ru/website/'));
  193.  
  194. // Add styles for floating button and dropdown
  195. GM_addStyle(`
  196. #bypassContainer {
  197. position: fixed;
  198. bottom: 10px;
  199. right: 10px;
  200. z-index: 99999999999;
  201. font-family: Arial, sans-serif;
  202. }
  203. #bypassButton {
  204. background: #333;
  205. color: white;
  206. border: none;
  207. padding: 8px 12px;
  208. cursor: pointer;
  209. font-size: 14px;
  210. display: flex;
  211. align-items: center;
  212. opacity: 0.8;
  213. border-radius: 4px;
  214. min-width: 150px;
  215. }
  216. #bypassButton:hover {
  217. opacity: 1;
  218. }
  219. #bypassButton img {
  220. width: 20px;
  221. margin-right: 8px;
  222. }
  223. #bypassDropdown {
  224. display: none;
  225. position: absolute;
  226. bottom: 100%;
  227. right: 0;
  228. background: white;
  229. border: 1px solid #ccc;
  230. border-radius: 4px;
  231. box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  232. margin-bottom: 5px;
  233. width: 200px;
  234. }
  235. #bypassDropdown.show {
  236. display: block;
  237. }
  238. .bypass-option {
  239. padding: 10px 15px;
  240. cursor: pointer;
  241. color: #333;
  242. border-bottom: 1px solid #eee;
  243. font-size: 14px;
  244. }
  245. .bypass-option:last-child {
  246. border-bottom: none;
  247. }
  248. .bypass-option:hover {
  249. background: #f5f5f5;
  250. }
  251. @media (max-width: 768px) {
  252. #bypassButton {
  253. padding: 10px 15px;
  254. font-size: 16px;
  255. }
  256. .bypass-option {
  257. padding: 12px 15px;
  258. font-size: 16px;
  259. }
  260. }
  261. `);
  262.  
  263. // Create container and button elements
  264. const container = document.createElement('div');
  265. container.id = 'bypassContainer';
  266.  
  267. const button = document.createElement('button');
  268. button.id = 'bypassButton';
  269. button.innerHTML = '<img src="data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////neHiwAAAAF3RSTlMAECAwQFBfYG9wf4CPkJ+gr7C/z9Df7yIhVIsAAAW1SURBVHic7VvZtpswDDTb5ZIUeuMU9P9/2nNMCF5mQAbap8xbwFi2pJHkJeaDDz744IMPPvjgYpRV07Zt29Z1af43irZ/TuLh+dPV5lrU/SQC31S3pyBMQ2OugpMu8kzfFK0VjvH7Cmu8pIvII35V3CbZxngz57BKF5F79LLdEy8iMp5whkC6iIQ2LbeU7+OgEmLpIlL5778105/xU5hcAOkSkKD4kQw880aApQckKEfJQsYImPSABLnyRQajwoZ0nwT58kU6s4tt6R4JjsiXaSck7UpfSVAckb9tBI30lQS/5Bgqg6GU/iZBKwfRY/k4kyHMJCj18SfChKkoaswk+M0bPIdhsBsOApNCJWo4ElADTPfXBGuqU2iDRtRwTsQm6If7O2kzogH0oobZUECYqFmeQE6gTakvEhD1RoVCQRwVxaI8EtT4VaLbB24HasRC1LhzCiQzI5Zq0wGQKSE01AVT7y4FAgygEzUqOtzUtESxYAB5JMCtUZYRCDAARAL7B338pJRBAU4ggBPGfJn6psA+/ACtHVB4ISaotxtOtpszJqTmnYXth0lBAnyakFevGvv6Hafgxw3zQVRrkQCfNpxJMNnOd2Q8/IqxG7kAjhdgadmHU5+Bh2+M6UYAWHDjeAHocu9K8BB9DEbPQeKFdrVOSaAGidjaxQkjgRokEFujA+ZwzmYHUUBrdMAGZDU1AFEArIcQcH4yepAa55dRAmacDBJ8C4Z6twhOQE8Ctm7Qe/F06nO2cBzVCjhJArZw1FLgLAlugqGNAWdJwORPGfuVZ0jwJQSK7ZE3TpCAylduEM04TgIqf8zZpMPViIYEVH6OA7BqREECKj8rj7Gl9f53XH5OImfVyD4JiPzRDjkEMKwa2SUB4r9bYuRDEPa0COSP7RHpB0mQyp9yFf/GERIMSfvx+EkRJMG09UWRyv9TvF9W7iAxo56DJNhKZUW6lF7kF7c1rKsrqlwSlKn8l/7DA7VNJXrA1Qj3KLRxX6I3Wg3gaoSeuyH5M2WrKKdpCxJcjTAfqoD8OfMlI9MmZFiNMPtVKHPPtV8yMm1CgNUIUd8XrBycB6QbCc6Nvoc3WJiEfWIS4PQzt01N42KpRzGDkUECUn46CwQKsF1VVo1TzPqQkUJPAlb+On/1o5m3HvDyDIssahIg+W3bNvNYyXl7gx/70JJgAM1WrXozDZbkXu8svepIUAzbzbyZBqr2emeRRUWCAu7kelrt0MOgdxpZYM8RCUos39MqUbVHMRaYcTUSkoCeGzut9tZa6+nxaa219sfcrLVeFJjc45RduCQP7MXPrd1rvDlhcZZPHQFWI4G9KirfkYBskve41DUJ4Dh9e1X82Na5G9kh7aBzAUeAX3sk+NqRzw6AauhcaTTcIwFffS10IwdABXSuNMXskICFf4/ueIdwws6VSwKF/DwSpCXBJgk25P/UtVf5s3jjmYfVmFskgOHfw+pRNXoYmoeUQ5jE86nonnycCQI3W82TV424TvZPmNeg7+3V+6pWZIKNI6n9E+bVB4iqvS7IZRZCYteJ7oR59tc46b7M43WRVY3MnehOmJ1qq/R3Y3QkgCSe7aW7ZuFWP14061+/K3OaBLprFs5f7+nvaHoHSKC8a+RU+0h+x4k6ryR3nSjvGjnVPpPfTqA3vaySfO5Ed9docfoFriQvLiEBu5gUApKgTkmQVZLPJCCXciIsTh/8bl9W9KZH5GM7zyTQsTAmwTJzZ8VzJNBd4ItJ8KK/lgTYzq5T5WWnmASvsS+usICRANvZdaq77LQ4/YJl5osrLMjcvc8Eq0Y8/bJceA3YutQbwNRWZZmxd5sHtgUQh9mMc8w8sC2AOJZmnePlwCNs8Dwm0r/yxJgEK6JYdvg8YweMBAmVr/v7TQhWkieB7ur/IC3YKvyCEVzx5x+EzcKvXC/7ao8vrkbZ3PthuLf/LAx9kIu/KxNpLm8PllAAAAAASUVORK5CYII="> Bypass Paywall (12ft.io)';
  270.  
  271. const dropdown = document.createElement('div');
  272. dropdown.id = 'bypassDropdown';
  273.  
  274. // Add dropdown options
  275. const options = [
  276. { text: '12ft.io', action: bypassPage },
  277. { text: 'PaywallBuster', action: bypassWithPaywallBuster },
  278. { text: 'Archive.today', action: () => archivePage('https://archive.today/newest/') },
  279. { text: 'Archive.is', action: () => archivePage('https://archive.is/newest/') },
  280. { text: 'Archive.ph', action: () => archivePage('https://archive.ph/newest/') },
  281. { text: 'RemovePaywall', action: () => archivePage('https://removepaywall.com/search?url=') },
  282. { text: 'Google Cache', action: () => archivePage('https://webcache.googleusercontent.com/search?q=cache:') },
  283. { text: 'Yandex Cache', action: () => archivePage('https://www.yandex.ru/search/?site=') },
  284. //{ text: 'CachedView -- Broken', action: () => archivePage('https://cachedview.foundtt.com/') },
  285. { text: 'Yahoo Cache', action: () => archivePage('https://search.yahoo.com/search?p=') },
  286. { text: 'Bing Cache', action: () => archivePage('https://www.bing.com/search?q=url:') },
  287. { text: 'Similar Web', action: () => archivePage('https://www.similarweb.com/ru/website/') },
  288. ];
  289.  
  290. options.forEach(option => {
  291. const div = document.createElement('div');
  292. div.className = 'bypass-option';
  293. div.textContent = option.text;
  294. div.addEventListener('click', (e) => {
  295. e.stopPropagation();
  296. option.action();
  297. dropdown.classList.remove('show');
  298. });
  299. dropdown.appendChild(div);
  300. });
  301.  
  302. // Add elements to container
  303. container.appendChild(button);
  304. container.appendChild(dropdown);
  305. document.body.appendChild(container);
  306.  
  307. // Toggle dropdown on button click
  308. button.addEventListener('click', (e) => {
  309. e.stopPropagation();
  310. const currentUrl = window.location.href;
  311. if (currentUrl.startsWith(_12FT_ORIGIN) || currentUrl.startsWith(PAYWALLBUSTER_ORIGIN)) {
  312. goBack();
  313. } else {
  314. dropdown.classList.toggle('show');
  315. }
  316. });
  317.  
  318. // Close dropdown when clicking outside
  319. document.addEventListener('click', () => {
  320. dropdown.classList.remove('show');
  321. });
  322.  
  323. // Function to bypass paywall with 12ft.io
  324. function bypassPage() {
  325. const currentUrl = window.location.href;
  326. if (isValidProtocol(currentUrl)) {
  327. window.location.href = _12FT_PREFIX + currentUrl;
  328. }
  329. }
  330.  
  331. // Function to bypass paywall with PaywallBuster
  332. function bypassWithPaywallBuster() {
  333. const currentUrl = window.location.href;
  334. if (isValidProtocol(currentUrl)) {
  335. window.location.href = PAYWALLBUSTER_PREFIX + currentUrl;
  336. }
  337. }
  338.  
  339. // Function to go back to original URL
  340. function goBack() {
  341. const currentUrl = window.location.href;
  342. const originalUrl = new URL(currentUrl).searchParams.get("q");
  343. if (originalUrl) {
  344. window.location.href = originalUrl;
  345. }
  346. }
  347.  
  348. // Check if the protocol is valid (http or https)
  349. function isValidProtocol(url) {
  350. return new URL(url).protocol.startsWith("http");
  351. }
  352.  
  353. // Remove banner on 12ft.io
  354. function removeBanner() {
  355. const banner = document.getElementById('ad');
  356. if (banner) {
  357. banner.remove();
  358. }
  359. }
  360.  
  361. // Function to open archive pages
  362. function archivePage(baseURL) {
  363. const currentUrl = window.location.href;
  364. if (isValidProtocol(currentUrl)) {
  365. window.location.href = baseURL + encodeURIComponent(currentUrl);
  366. }
  367. }
  368.  
  369. // Mutation observer to remove banner if it appears
  370. const observer = new MutationObserver((mutations) => {
  371. for (const mutation of mutations) {
  372. if (mutation.addedNodes.length) {
  373. removeBanner();
  374. }
  375. }
  376. });
  377.  
  378. observer.observe(document.body, { childList: true, subtree: true });
  379.  
  380. // Initial banner removal
  381. removeBanner();
  382.  
  383. // Remove duplicate button inside iframe
  384. function removeDuplicateButton() {
  385. const iframe = document.getElementById('proxy-frame');
  386. if (iframe) {
  387. const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
  388. const duplicateButton = iframeDocument.getElementById('bypassButton');
  389. if (duplicateButton) {
  390. duplicateButton.remove();
  391. }
  392. }
  393. }
  394.  
  395. window.addEventListener('load', removeDuplicateButton);
  396. })();