Answer the question
In order to leave comments, you need to log in
Userscript to disable player blocking on filmsonline.com.ua?
On filmsonline.com.ua , when Adblock is enabled, a warning blocking the player pops up on top of the player: "You are using our player with an ad blocker enabled!
We ask you to put our player in the blocker exception, otherwise we will not be able to further support it"
Of course, you can just get into the source code of the page and remove the block with a warning, but I would like to format it in the form of UserCSS / UserJS.
First I tried adding UserCSS to the page with Stylish - no effect. I thought that perhaps the styles for this block are generated by scripts after the page is loaded, so Stylish does not work. I wrote this UserJS using CustomJS:
document.body.addEventListener("click", function() {
sheet = (function() {
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
return style.sheet;
})();
sheet.insertRule("a-overlay, a-head, a-body, a-container, a-bounceInDown { display: none !important; }", 0);
console.log("Success!");
});
body {display: none}
, then on click the page is cleared. Why is it not possible to remove ads in this way? document.querySelectorAll('.a-overlay')
and document.getElementsByClassName('a-overlay')
. At the same time, there is no Cyrillic alphabet in the class names, I checked, everything is in Latin.
Answer the question
In order to leave comments, you need to log in
Because you are doing document.getElementsByClassName('a-overlay') on the page, and this element is in a frame. The script should look like this:
// ==UserScript==
//@include http://*.moviki.ru/*
// ==/UserScript==
var elem = document.getElementsByClassName('a-overlay')[0];
elem.parentNode.removeChild(elem);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question