Answer the question
In order to leave comments, you need to log in
How to block the execution of a crooked plugin for Google Chrome?
I ran into a problem, the www.complitly.com/
plugin in chrome constantly knocks on the server at site.com/undefined, which creates an extra load on the server.
How can the site (namely the site, not the server) block this plugin? I tried to redefine its functions in JS, but in vain ...
Answer the question
In order to leave comments, you need to log in
You can hang a content-dependent hook on the String prototype function.
The plugin uses this construction somestring.replace(/^[^\?]+(\?)*/, '');
for some of its purposes
. We can rewrite String.prototype.replace
and, depending on the arguments, throw an exception that is unexpected for it (thus interrupting the plugin at the very beginning).
(function (){
var realStringPrototypeReplace = String.prototype.replace;
String.prototype.replace = function (what) {
if (what.toString() === "/^[^\\?]+(\\?)*/") {
throw new TypeError();
} else {
return realStringPrototypeReplace.apply(this, arguments);
}
};
}());
Not a plugin, but an extension. And don't you think that the very idea that you can block a browser extension through a website is absurd? That's something users of some AdBlock would be constantly surprised.
If we are talking about the fact that this plugin constantly goes to some URL, then this can be a normal solution for a search system with autocomplete, which this system is.
So what do you still want, I do not understand?
… which puts extra load on the server .
What other server is causing the load? Is the plugin constantly trying to access the server you own by url? I do not understand.
How can the site (namely the site, not the server) block this plugin?
What is the difference between a site and a server in your terminology?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question