popup.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
  5. <meta content="utf-8" http-equiv="encoding" />
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  7. <!--
  8. /*******************************************************************************
  9. Cloud Firewall - a browser extension/addon that allows you to toggle blocking
  10. ON or OFF for allowing your browser to connect to web pages and web resources (
  11. like images, videos) hosted on popular top 5 cloud/companies.
  12. Copyright (C) 2019 Niklas Poslovski
  13. Copyright (C) 2019 Gokulakrishna Sudharsan
  14. This program is free software: you can redistribute it and/or modify
  15. it under the terms of the GNU General Public License as published by
  16. the Free Software Foundation, either version 3 of the License, or
  17. (at your option) any later version.
  18. This program is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. GNU General Public License for more details.
  22. You should have received a copy of the GNU General Public License
  23. along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. Home: https://notabug.org/nipos/cloud-firewall
  25. */
  26. -->
  27. <title>Cloud Firewall</title>
  28. <link rel="stylesheet" href="css/popup2.css" />
  29. <link rel="stylesheet" href="css/toggleswitch.css" />
  30. <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
  31. <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
  32. <script src="js/popup/registerListeners.js"></script>
  33. <script src="libraries/publicsuffixlist.min.js"></script>
  34. <script src="libraries/punycode.js"></script>
  35. <script src="libraries/uritools.js"></script>
  36. <script src="libraries/json2yaml.js"></script>
  37. <script src="libraries/JSON2Plain.js"></script>
  38. <script src="libraries/tomlify.js"></script>
  39. <script src="libraries/cson-parser-4.0.2-stringify.js"></script>
  40. <script src="js/dom/DOMUpdater.js"></script>
  41. <script src="js/dom/common.js"></script>
  42. <script src="js/popup/popup.js"></script>
  43. </head>
  44. <!--https://codepen.io/ondrejsvestka/pen/qmbeMe-->
  45. <!--https://stackoverflow.com/questions/20979062/bootstrap-right-column-on-top-on-mobile-view-->
  46. <body class="hideBody">
  47. <div
  48. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  49. ></div>
  50. <div class="container" style="white-space: nowrap;">
  51. <img class="resize_fit_center" src="images/shield.png" />
  52. <span style=" font-size: 19px; white-space: nowrap;"
  53. ><strong>Cloud&nbsp;Firewall</strong></span
  54. >
  55. </div>
  56. <div
  57. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  58. ></div>
  59. <div class="row">
  60. <div class="col" id="statsTableDesktop">
  61. <br />
  62. <table>
  63. <tr id="showstats" class="spaceUnder" align="center">
  64. <td>
  65. <div
  66. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  67. ></div>
  68. <div style="white-space: nowrap;">
  69. <img src="images/cloud.svg" />Connections&nbsp;Blocked:
  70. </div>
  71. <div
  72. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  73. ></div>
  74. <em>Since Install </em>
  75. <div
  76. style="text-align:center;white-space: nowrap;"
  77. id="countsgoogle"
  78. ></div>
  79. <div
  80. style="text-align:center;white-space: nowrap;"
  81. id="countsamazon"
  82. ></div>
  83. <div
  84. style="text-align:center;white-space: nowrap;"
  85. id="countsfacebook"
  86. ></div>
  87. <div
  88. style="text-align:center;white-space: nowrap;"
  89. id="countsapple"
  90. ></div>
  91. <div
  92. style="text-align:center;white-space: nowrap;"
  93. id="countsmicrosoft"
  94. ></div>
  95. <div
  96. style="text-align:center;white-space: nowrap;"
  97. id="countscloudflare"
  98. ></div>
  99. <em
  100. ><div
  101. style="text-align:center;white-space: nowrap;"
  102. id="countstotal"
  103. ></div
  104. ></em>
  105. </td>
  106. </tr>
  107. <tr id="pageshowstats" class="spaceUnder" align="center">
  108. <td>
  109. <div
  110. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  111. ></div>
  112. <em>On this Page</em>
  113. <div id="hostnameToDisplay" style="word-wrap:anywhere"></div>
  114. <div
  115. style="text-align:center;white-space: nowrap;"
  116. id="pagecountsgoogle"
  117. ></div>
  118. <div
  119. style="text-align:center;white-space: nowrap;"
  120. id="pagecountsamazon"
  121. ></div>
  122. <div
  123. style="text-align:center;white-space: nowrap;"
  124. id="pagecountsfacebook"
  125. ></div>
  126. <div
  127. style="text-align:center;white-space: nowrap;"
  128. id="pagecountsapple"
  129. ></div>
  130. <div
  131. style="text-align:center;white-space: nowrap;"
  132. id="pagecountsmicrosoft"
  133. ></div>
  134. <div
  135. style="text-align:center;white-space: nowrap;"
  136. id="pagecountscloudflare"
  137. ></div>
  138. <em>
  139. <div style="text-align:center;" id="pagecountstotal"></div
  140. ></em>
  141. <span id="copyBtnArea">
  142. <a class="btn btn-outline-dark btn-sm" id="showInPopup" tabindex="-1">Show URLs in popup</a><br/>
  143. <div>Copy <span id="allText"></span><span id="totalcountsForCopyBtn"></span><span id="urlText"></span> as:</div><div><a class="btn btn-outline-dark btn-sm" id="copyToClipboardYAML" tabindex="-1">YAML</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardTOML" tabindex="-1">TOML</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardPlain" tabindex="-1">Plain</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardCSON" tabindex="-1">CSON</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardJSON" tabindex="-1">JSON</a></div></span>
  144. </td>
  145. </tr>
  146. <!-- <a class="btn blue large" href="help.html" target="_blank">Help</a>-->
  147. </table>
  148. </div>
  149. <div class="col">
  150. <table
  151. width="100%"
  152. style="min-width: 120px; "
  153. align="center"
  154. id="tableMain"
  155. >
  156. <!--
  157. <tr class="spaceUnder" id="showenablebutton" align="center">
  158. <td>
  159. <div class="alert alert-danger" tabindex="-1" style="">
  160. Cloud Firewall is disabled!
  161. </div>
  162. <button
  163. type="button"
  164. class="btn btn-success btn-sm"
  165. id="enablebutton"
  166. tabindex="-1"
  167. >
  168. Enable Cloud Firewall
  169. </button>
  170. </td>
  171. </tr> -->
  172. <tr class="spaceUnder" align="center" id="settingsbuttonarea">
  173. <td>
  174. <button type="button" class="btn btn-primary btn-sm" id="settingsbutton" tabindex="-1">Edit Settings</button>
  175. <button type="button" class="btn btn-info btn-sm formfineleft" id="helpButton">Help</button>
  176. <br />
  177. </td>
  178. </tr>
  179. <tr class="spaceUnder" align="left" id="togglegroup">
  180. <td>
  181. <label class="md_switch">
  182. <input type="checkbox" id="switchgoogle" />
  183. <span class="md_switch__toggle"></span>
  184. &nbsp;&nbsp;&nbsp;Block&nbsp;Google</label><br />
  185. <label class="md_switch">
  186. <input type="checkbox" id="switchamazon" />
  187. <span class="md_switch__toggle"></span>
  188. &nbsp;&nbsp;&nbsp;Block&nbsp;Amazon</label><br />
  189. <label class="md_switch">
  190. <input type="checkbox" id="switchfacebook" />
  191. <span class="md_switch__toggle"></span>
  192. &nbsp;&nbsp;&nbsp;Block&nbsp;Facebook</label><br />
  193. <label class="md_switch" data-on="yes" data-off="no">
  194. <input type="checkbox" id="switchapple" />
  195. <span class="md_switch__toggle"></span>
  196. &nbsp;&nbsp;&nbsp;Block&nbsp;Apple</label><br />
  197. <label class="md_switch">
  198. <input type="checkbox" id="switchmicrosoft" />
  199. <span class="md_switch__toggle"></span>
  200. &nbsp;&nbsp;&nbsp;Block&nbsp;Microsoft</label><br />
  201. <label class="md_switch" data-on="yes" data-off="no">
  202. <input type="checkbox" id="switchcloudflare" />
  203. <span class="md_switch__toggle"></span>
  204. <span style="display: inline;">
  205. &nbsp;&nbsp;&nbsp;Block&nbsp;Cloudflare</span></label>
  206. <!-- <span id="2BR"><br /></span>
  207. -->
  208. <br/> <!-- <div>
  209. <div
  210. class="alert alert-info"
  211. tabindex="-1"
  212. id="inExcludesAlert"
  213. style="display:none;"
  214. ></div> -->
  215. <button class="btn btn-outline-light text-dark" type="button" id="blockAllButton" tabindex="-1">Block all</button>&nbsp;&nbsp;&nbsp;
  216. <button class="btn btn-outline-light text-dark" type="button" id="allowAllButton" tabindex="-1">Allow all</button>
  217. <br/>
  218. <div align="center">
  219. <div id="inExcludesAlertWrapper" style="display:none;">
  220. <div id="inExcludesAlert" class="alert alert-info" tabindex="-1"></div>
  221. </div>
  222. <button class="btn btn-outline-dark" id="addToExcludes" tabindex="-1" style="white-space:normal;word-wrap:anywhere">Disable for {domain}</button>
  223. <button class="btn btn-outline-dark" id="removeFromExcludes" tabindex="-1" style="white-space:normal;word-wrap:anywhere">Include {domain}</button>
  224. </div>
  225. </div>
  226. </td>
  227. </tr>
  228. <!--
  229. <tr class="spaceUnder" align="center" id="showdisablebutton">
  230. <td>
  231. <button
  232. type="button"
  233. class="btn btn-outline-dark btn-sm"
  234. id="disablebutton"
  235. tabindex="-1"
  236. >
  237. Disable Cloud Firewall temporarily
  238. </button>
  239. </td>
  240. </tr>
  241. -->
  242. <!-- <tr class="spaceUnder" align="center">
  243. <td>
  244. <button
  245. type="button"
  246. class="btn btn-info btn-sm formfineleft"
  247. id="helpButton"
  248. >
  249. Help
  250. </button>
  251. </td>
  252. </tr> -->
  253. </table>
  254. </div>
  255. </div>
  256. <!-- temporary duplicate of stats table as I don't yet have the time to do bootstrap classes things to push left column table to bottom of screen in android firefox screen-->
  257. <table
  258. id="statsTableAndroid"
  259. width="100%"
  260. style="min-width: 120px; "
  261. align="center"
  262. >
  263. <!-- <div id="inExcludesAlertWrapper" style="display:none;">
  264. <div id="inExcludesAlert" class="alert alert-info" tabindex="-1"></div>
  265. </div> -->
  266. <tr id="showstats" class="spaceUnder" align="center">
  267. <td>
  268. <div
  269. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  270. ></div>
  271. <div style="white-space: nowrap;">
  272. <img src="images/cloud.svg" />Connections Blocked:
  273. </div>
  274. <div
  275. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  276. ></div>
  277. <em>Since Install: </em>
  278. <div
  279. style="text-align:center;white-space: nowrap;"
  280. id="countsgoogle"
  281. ></div>
  282. <div
  283. style="text-align:center;white-space: nowrap;"
  284. id="countsamazon"
  285. ></div>
  286. <div
  287. style="text-align:center;white-space: nowrap;"
  288. id="countsfacebook"
  289. ></div>
  290. <div
  291. style="text-align:center;white-space: nowrap;"
  292. id="countsapple"
  293. ></div>
  294. <div
  295. style="text-align:center;white-space: nowrap;"
  296. id="countsmicrosoft"
  297. ></div>
  298. <div
  299. style="text-align:center;white-space: nowrap;"
  300. id="countscloudflare"
  301. ></div>
  302. <em
  303. ><div
  304. style="text-align:center;white-space: nowrap;"
  305. id="countstotal"
  306. ></div
  307. ></em>
  308. </td>
  309. </tr>
  310. <tr id="pageshowstats" class="spaceUnder" align="center">
  311. <td>
  312. <div
  313. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  314. ></div>
  315. <em>On this Page</em>
  316. <div id="hostnameToDisplay"></div>
  317. <div
  318. style="text-align:center; white-space: nowrap;"
  319. id="pagecountsgoogle"
  320. ></div>
  321. <div
  322. style="text-align:center; white-space: nowrap;"
  323. id="pagecountsamazon"
  324. ></div>
  325. <div
  326. style="text-align:center; white-space: nowrap;"
  327. id="pagecountsfacebook"
  328. ></div>
  329. <div
  330. style="text-align:center; white-space: nowrap;"
  331. id="pagecountsapple"
  332. ></div>
  333. <div
  334. style="text-align:center; white-space: nowrap;"
  335. id="pagecountsmicrosoft"
  336. ></div>
  337. <div
  338. style="text-align:center; white-space: nowrap;"
  339. id="pagecountscloudflare"
  340. ></div>
  341. <em>
  342. <div
  343. style="text-align:center; white-space: nowrap;"
  344. id="pagecountstotal"
  345. ></div>
  346. </em>
  347. <span id="copyBtnArea">
  348. <a class="btn btn-outline-dark btn-sm" id="showInPopup" tabindex="-1">Show URLs in popup</a><br/>
  349. <div>Copy <span id="allText"></span><span id="totalcountsForCopyBtn"></span><span id="urlText"></span> as:</div><div><a class="btn btn-outline-dark btn-sm" id="copyToClipboardYAML" tabindex="-1">YAML</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardTOML" tabindex="-1">TOML</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardPlain" tabindex="-1">Plain</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardCSON" tabindex="-1">CSON</a><a class="btn btn-outline-dark btn-sm" id="copyToClipboardJSON" tabindex="-1">JSON</a></div></span>
  350. </td>
  351. </tr>
  352. <!-- <a class="btn blue large" href="help.html" target="_blank">Help</a>-->
  353. </table>
  354. <div
  355. style="margin: 0px; padding: 0px; border: 0px solid rgb(6, 117, 211); font-size: 19px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 1; font-family: sans-serif; vertical-align: baseline; box-sizing: content-box; overflow: unset; height: 1px; position: relative; width: auto; display: flex; background-color: rgb(9, 150, 248); color: rgb(255, 255, 255); text-align: left; align-items: center; border-radius: 3px; justify-content: center; text-decoration: none;"
  356. ></div>
  357. <footer>
  358. <small><div style="text-align:center;" id="versiondisplay"></div></small>
  359. </footer>
  360. </body>
  361. </html>