Better Web (beta)

Block Porn Sites, Horoscope Sites, Gambling Sites

  1. // ==UserScript==
  2. // @name Better Web (beta)
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.4
  5. // @description Block Porn Sites, Horoscope Sites, Gambling Sites
  6. // @license GNU GPLv3
  7. // @author Yusuf Sameh
  8. // @match https://greasyfork.org/en/scripts?q=porn+blocker
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
  10. // @grant none
  11. // @include https://*.pornhub.com/*
  12. // @include https://*.xhamster.com/*
  13. // @include https://*.xvideos.com/*
  14. // @include https://*.thegay.com/*
  15. // @include https://*.gay.bingo/*
  16. // @include https://*.thisvid.com/*
  17. // @include https://*.youporn.com/*
  18. // @include https://*.stripchat.com/*
  19. // @include https://*.slot.com/*
  20. // @include https://*.casino.org/*
  21. // @include https://*.slotomania.com/*
  22. // @include *pornhub*
  23. // @include *dick*
  24. // @include *pussy*
  25. // @include *cum*
  26. // @include *nude*
  27. // @include *nudity*
  28. // @include *ome*
  29. // @include *porn*
  30. // @include *houseparty*
  31. // @include *sex*
  32. // @include *gay*
  33. // @include *feet*
  34. // @include *male slave*
  35. // @include *telonym*
  36. // @include *kik*
  37. // @include *rule34*
  38. // @include *xhamster*
  39. // @include *yolo*
  40. // @include *fuck*
  41. // @include *suck*
  42. // @include *tinder*
  43. // @include *periscope*
  44. // @include *ask.fm*
  45. // @include *4chan*
  46. // @include *8chan*
  47. // @include *chatroulette*
  48. // @include *youporn*
  49. // @include *hentai*
  50. // @include *daddy*
  51. // @include *xx*
  52. // @include *nsfw*
  53. // @include *gambling*
  54. // @include *777*
  55. // @include *777slots*
  56. // @include *blackjack*
  57. // @include *poker*
  58. // @include *casino games*
  59. // @include *free slots*
  60. // @include *horoscope*
  61. // @run-at document-start
  62. // @namespace https://greasyfork.org/users/12417
  63. // ==/UserScript==
  64.  
  65. function block() // Function will block the website.
  66. {
  67. var current = window.location.href;
  68. window.history.back(); // Attempt to go back (if it's opened in a tab with no tab history)
  69. if (window.location.href == current) // If it's still there
  70. {
  71. window.close(); // Attempt to close page
  72. if (window.location.href == current) // If it's still there (if it's the only tab)
  73. {
  74. window.location.href = "about://newtab"; // Go to a new tab; always works!
  75. }
  76. }
  77. }
  78. // ==/UserScript==
  79.  
  80. (function() {
  81. 'use strict';
  82. block();
  83. // Your code here...
  84. })();