popup.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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/background/variables.js"></script>
  33. <script src="js/popup/registerListeners.js"></script>
  34. <script src="libraries/publicsuffixlist.min.js"></script>
  35. <script src="libraries/punycode.js"></script>
  36. <script src="libraries/uritools.js"></script>
  37. <script src="libraries/json2yaml.js"></script>
  38. <script src="libraries/JSON2Plain.js"></script>
  39. <script src="libraries/tomlify.js"></script>
  40. <script src="libraries/cson-parser-4.0.3-stringify.js"></script>
  41. <script src="js/dom/DOMUpdater.js"></script>
  42. <script src="js/dom/common.js"></script>
  43. <script src="js/popup/popup.js"></script>
  44. </head>
  45. <!--https://codepen.io/ondrejsvestka/pen/qmbeMe-->
  46. <!--https://stackoverflow.com/questions/20979062/bootstrap-right-column-on-top-on-mobile-view-->
  47. <body class="hideBody">
  48. <div
  49. 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;"
  50. ></div>
  51. <div class="container" style="white-space: nowrap;">
  52. <img class="resize_fit_center" src="images/shield.png" />
  53. <span style=" font-size: 19px; white-space: nowrap;"
  54. ><strong>Cloud&nbsp;Firewall</strong></span
  55. >
  56. </div>
  57. <div
  58. 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;"
  59. ></div>
  60. <div class="row">
  61. <div class="col" id="statsTableDesktop">
  62. <br />
  63. <table>
  64. <tr id="showstats" class="spaceUnder" align="center">
  65. <td>
  66. <div
  67. 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;"
  68. ></div>
  69. <div style="white-space: nowrap;">
  70. <img src="images/cloud.svg" />Connections&nbsp;Blocked:
  71. </div>
  72. <div
  73. 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;"
  74. ></div>
  75. <em>Since Install </em>
  76. <div
  77. style="text-align:center;white-space: nowrap;"
  78. id="countsgoogle"
  79. ></div>
  80. <div
  81. style="text-align:center;white-space: nowrap;"
  82. id="countsamazon"
  83. ></div>
  84. <div
  85. style="text-align:center;white-space: nowrap;"
  86. id="countsfacebook"
  87. ></div>
  88. <div
  89. style="text-align:center;white-space: nowrap;"
  90. id="countsapple"
  91. ></div>
  92. <div
  93. style="text-align:center;white-space: nowrap;"
  94. id="countsmicrosoft"
  95. ></div>
  96. <div
  97. style="text-align:center;white-space: nowrap;"
  98. id="countscloudflare"
  99. ></div>
  100. <em
  101. ><div
  102. style="text-align:center;white-space: nowrap;"
  103. id="countstotal"
  104. ></div
  105. ></em>
  106. </td>
  107. </tr>
  108. <tr id="pageshowstats" class="spaceUnder" align="center">
  109. <td>
  110. <div
  111. 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;"
  112. ></div>
  113. <em>On this Page</em>
  114. <div id="hostnameToDisplay" style="word-wrap:anywhere"></div>
  115. <div
  116. style="text-align:center;white-space: nowrap;"
  117. id="pagecountsgoogle"
  118. ></div>
  119. <div
  120. style="text-align:center;white-space: nowrap;"
  121. id="pagecountsamazon"
  122. ></div>
  123. <div
  124. style="text-align:center;white-space: nowrap;"
  125. id="pagecountsfacebook"
  126. ></div>
  127. <div
  128. style="text-align:center;white-space: nowrap;"
  129. id="pagecountsapple"
  130. ></div>
  131. <div
  132. style="text-align:center;white-space: nowrap;"
  133. id="pagecountsmicrosoft"
  134. ></div>
  135. <div
  136. style="text-align:center;white-space: nowrap;"
  137. id="pagecountscloudflare"
  138. ></div>
  139. <em>
  140. <div style="text-align:center;" id="pagecountstotal"></div
  141. ></em>
  142. <span id="copyBtnArea">
  143. <a class="btn btn-outline-dark btn-sm" id="showInPopup" tabindex="-1">Show URLs in popup</a><br/>
  144. <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>
  145. </td>
  146. </tr>
  147. <!-- <a class="btn blue large" href="help.html" target="_blank">Help</a>-->
  148. </table>
  149. </div>
  150. <div class="col">
  151. <table
  152. width="100%"
  153. style="min-width: 120px; "
  154. align="center"
  155. id="tableMain"
  156. >
  157. <!--
  158. <tr class="spaceUnder" id="showenablebutton" align="center">
  159. <td>
  160. <div class="alert alert-danger" tabindex="-1" style="">
  161. Cloud Firewall is disabled!
  162. </div>
  163. <button
  164. type="button"
  165. class="btn btn-success btn-sm"
  166. id="enablebutton"
  167. tabindex="-1"
  168. >
  169. Enable Cloud Firewall
  170. </button>
  171. </td>
  172. </tr> -->
  173. <tr class="spaceUnder" align="center" id="settingsbuttonarea">
  174. <td>
  175. <button type="button" class="btn btn-primary btn-sm" id="settingsbutton" tabindex="-1">Edit Settings</button>
  176. <button type="button" class="btn btn-info btn-sm formfineleft" id="helpButton">Help</button>
  177. <br />
  178. </td>
  179. </tr>
  180. <tr class="spaceUnder" align="left" id="togglegroup">
  181. <td>
  182. <label class="md_switch">
  183. <input type="checkbox" id="switchgoogle" />
  184. <span class="md_switch__toggle"></span>
  185. &nbsp;&nbsp;&nbsp;Block&nbsp;Google</label><br />
  186. <label class="md_switch">
  187. <input type="checkbox" id="switchamazon" />
  188. <span class="md_switch__toggle"></span>
  189. &nbsp;&nbsp;&nbsp;Block&nbsp;Amazon</label><br />
  190. <label class="md_switch">
  191. <input type="checkbox" id="switchfacebook" />
  192. <span class="md_switch__toggle"></span>
  193. &nbsp;&nbsp;&nbsp;Block&nbsp;Facebook</label><br />
  194. <label class="md_switch" data-on="yes" data-off="no">
  195. <input type="checkbox" id="switchapple" />
  196. <span class="md_switch__toggle"></span>
  197. &nbsp;&nbsp;&nbsp;Block&nbsp;Apple</label><br />
  198. <label class="md_switch">
  199. <input type="checkbox" id="switchmicrosoft" />
  200. <span class="md_switch__toggle"></span>
  201. &nbsp;&nbsp;&nbsp;Block&nbsp;Microsoft</label><br />
  202. <label class="md_switch" data-on="yes" data-off="no">
  203. <input type="checkbox" id="switchcloudflare" />
  204. <span class="md_switch__toggle"></span>
  205. <span style="display: inline;">
  206. &nbsp;&nbsp;&nbsp;Block&nbsp;Cloudflare</span></label>
  207. <!-- <span id="2BR"><br /></span>
  208. -->
  209. <br/> <!-- <div>
  210. <div
  211. class="alert alert-info"
  212. tabindex="-1"
  213. id="inExcludesAlert"
  214. style="display:none;"
  215. ></div> -->
  216. <button class="btn btn-outline-light text-dark" type="button" id="blockAllButton" tabindex="-1">Block all</button>&nbsp;&nbsp;&nbsp;
  217. <button class="btn btn-outline-light text-dark" type="button" id="allowAllButton" tabindex="-1">Allow all</button>
  218. <br/>
  219. <div align="center">
  220. <div id="inExcludesAlertWrapper" style="display:none;">
  221. <div id="inExcludesAlert" class="alert alert-info" tabindex="-1"></div>
  222. </div>
  223. <button class="btn btn-outline-dark" id="addToExcludes" tabindex="-1" style="white-space:normal;word-wrap:anywhere">Disable for {domain}</button>
  224. <button class="btn btn-outline-dark" id="removeFromExcludes" tabindex="-1" style="white-space:normal;word-wrap:anywhere">Include {domain}</button>
  225. </div>
  226. </div>
  227. </td>
  228. </tr>
  229. <!--
  230. <tr class="spaceUnder" align="center" id="showdisablebutton">
  231. <td>
  232. <button
  233. type="button"
  234. class="btn btn-outline-dark btn-sm"
  235. id="disablebutton"
  236. tabindex="-1"
  237. >
  238. Disable Cloud Firewall temporarily
  239. </button>
  240. </td>
  241. </tr>
  242. -->
  243. <!-- <tr class="spaceUnder" align="center">
  244. <td>
  245. <button
  246. type="button"
  247. class="btn btn-info btn-sm formfineleft"
  248. id="helpButton"
  249. >
  250. Help
  251. </button>
  252. </td>
  253. </tr> -->
  254. </table>
  255. </div>
  256. </div>
  257. <!-- 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-->
  258. <table
  259. id="statsTableAndroid"
  260. width="100%"
  261. style="min-width: 120px; "
  262. align="center"
  263. >
  264. <!-- <div id="inExcludesAlertWrapper" style="display:none;">
  265. <div id="inExcludesAlert" class="alert alert-info" tabindex="-1"></div>
  266. </div> -->
  267. <tr id="showstats" class="spaceUnder" align="center">
  268. <td>
  269. <div
  270. 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;"
  271. ></div>
  272. <div style="white-space: nowrap;">
  273. <img src="images/cloud.svg" />Connections Blocked:
  274. </div>
  275. <div
  276. 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;"
  277. ></div>
  278. <em>Since Install: </em>
  279. <div
  280. style="text-align:center;white-space: nowrap;"
  281. id="countsgoogle"
  282. ></div>
  283. <div
  284. style="text-align:center;white-space: nowrap;"
  285. id="countsamazon"
  286. ></div>
  287. <div
  288. style="text-align:center;white-space: nowrap;"
  289. id="countsfacebook"
  290. ></div>
  291. <div
  292. style="text-align:center;white-space: nowrap;"
  293. id="countsapple"
  294. ></div>
  295. <div
  296. style="text-align:center;white-space: nowrap;"
  297. id="countsmicrosoft"
  298. ></div>
  299. <div
  300. style="text-align:center;white-space: nowrap;"
  301. id="countscloudflare"
  302. ></div>
  303. <em
  304. ><div
  305. style="text-align:center;white-space: nowrap;"
  306. id="countstotal"
  307. ></div
  308. ></em>
  309. </td>
  310. </tr>
  311. <tr id="pageshowstats" class="spaceUnder" align="center">
  312. <td>
  313. <div
  314. 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;"
  315. ></div>
  316. <em>On this Page</em>
  317. <div id="hostnameToDisplay"></div>
  318. <div
  319. style="text-align:center; white-space: nowrap;"
  320. id="pagecountsgoogle"
  321. ></div>
  322. <div
  323. style="text-align:center; white-space: nowrap;"
  324. id="pagecountsamazon"
  325. ></div>
  326. <div
  327. style="text-align:center; white-space: nowrap;"
  328. id="pagecountsfacebook"
  329. ></div>
  330. <div
  331. style="text-align:center; white-space: nowrap;"
  332. id="pagecountsapple"
  333. ></div>
  334. <div
  335. style="text-align:center; white-space: nowrap;"
  336. id="pagecountsmicrosoft"
  337. ></div>
  338. <div
  339. style="text-align:center; white-space: nowrap;"
  340. id="pagecountscloudflare"
  341. ></div>
  342. <em>
  343. <div
  344. style="text-align:center; white-space: nowrap;"
  345. id="pagecountstotal"
  346. ></div>
  347. </em>
  348. <span id="copyBtnArea">
  349. <a class="btn btn-outline-dark btn-sm" id="showInPopup" tabindex="-1">Show URLs in popup</a><br/>
  350. <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>
  351. </td>
  352. </tr>
  353. <!-- <a class="btn blue large" href="help.html" target="_blank">Help</a>-->
  354. </table>
  355. <div
  356. 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;"
  357. ></div>
  358. <footer>
  359. <small><div style="text-align:center;" id="versiondisplay"></div></small>
  360. </footer>
  361. </body>
  362. </html>