T
T
Tpy6okyp2016-03-13 02:04:00
Content
Tpy6okyp, 2016-03-13 02:04:00

Filtering web pages according to your list: found a word - did not let it into the site?

Good day!
Interested in the question of creating a rule in which, having a list with certain words, we would not be allowed to the page of the site, which has at least one of the listed words.
For example: We have the word "musician" in the list - we go to Google - we look for the history of a piece of music - we go to a site where there is a word from the list - the tab opens and immediately closes (either a warning with confirmation first, or else your option).
Actually the question is: how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wernalur, 2016-03-13
@Tpy6okyp

Have you considered the option with userscript?
Something like

// ==UserScript==
// @name        test
// @namespace   UCqMyrFNs4M9nPMTA2EvtCr8XwQzLHrm
// @include     *
// @version     1
// @grant       none
// ==/UserScript==

var bad = ["кошка", "собака"];

var code = document.getElementsByTagName('html')[0].innerHTML.toLowerCase();
for (var a = 0; a < bad.length; a++)
{
  var rgxp = new RegExp(bad[a],"i");
  var result = code.search(rgxp);
  if (result !== -1)
  {
    window.close();
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question