GrabzIt
Tools to Capture and Convert the Web

How to disable JavaScript inline popups?

Some web pages contain unwanted inline JavaScript popups that appear in screenshots generated with our API's and Online Screenshot Tool. The most reliable technique to hide these popups is to specify the HTML elements of the popup to hide. Below is the HTML snippet of a inline popup we want to remove.

<div class="ArevicoModal-bg ArevicoModal-iframe" style="display: block;"></div>
<div class="ArevicoModal ArevicoModal-iframe" style="display: block;">
 <div class="ArevicoModal-content">
  <span class="ArevicoModal-close-icon ArevicoModal-close"></span>
  <div id="arvlbdata" style="overflow:visible;width:400px;height:250px;" class="ArevicoModal-inner">
   <h2>Sign up now!!</h2>
  </div>
 </div>
</div>

Therefore to remove this popup we need to hide all the popup elements that are blocking the page using the elements CSS selectors. In this case it is .ArevicoModal-bg and .ArevicoModal. You can find out what HTML elements you need to remove by using the developer tools of your web browser. An example of hiding the .ArevicoModal-bg and .ArevicoModal HTML elements are shown for each API below.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
ImageOptions options = new ImageOptions();
options.HideElement = ".ArevicoModal-bg,.ArevicoModal";
grabzIt.URLToImage("http://www.google.com", options);
grabzIt.SaveTo("google.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
ImageOptions options = new ImageOptions();
options.hideElement(".ArevicoModal-bg,.ArevicoModal");
grabzIt.URLToImage("http://www.google.com", options);
grabzIt.SaveTo("google.jpg");
<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.google.com", 
	{"hide", ".ArevicoModal-bg,.ArevicoModal"}).Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.url_to_image("http://www.google.com", 
	{"hideElement", ".ArevicoModal-bg,.ArevicoModal"});
client.save_to("google.jpg");
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = GrabzItImageOptions->new();
$options->hideElement(".ArevicoModal-bg,.ArevicoModal");
$grabzIt->URLToImage("http://www.google.com", $options);
$grabzIt->SaveTo("google.jpg");
$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new GrabzItImageOptions();
$options->setHideElement(".ArevicoModal-bg,.ArevicoModal");
$grabzIt->URLToImage("http://www.google.com", $options);
$grabzIt->SaveTo("google.jpg");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzItImageOptions.GrabzItImageOptions()
options.hideElement = ".ArevicoModal-bg,.ArevicoModal"
grabzIt.URLToImage("http://www.google.com", options)
grabzIt.SaveTo("google.jpg")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::ImageOptions.new()
options.hideElement(".ArevicoModal-bg,.ArevicoModal")
grabzIt.url_to_image("http://www.google.com", options)
grabzIt.save_to("google.jpg")

Other Techniques

Some popups are controlled with cookies, therefore if you set the correct cookie value for that domain the popup may no longer appear. This can be done manually or automatically by enabling the user cookie behavior mode.

To do this visit the web page and open your browser's developer tools facility so that you can see what cookies are present on the web page. Now close the popup. If a new cookie appears refresh the page. If the popup no longer appears copy the details of the cookie that appeared and add it to your custom cookies. However it would be a good idea to give it a long expiry date perhaps 10 years in the future so that the cookie isn't deleted.

Another potential solution is to request captures using the search engine user agent, by setting the "request as" parameter. Depending on how the website was written it may cause the pop-up not to appear.

Back to SupportMore screenshot questions
Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial