Execute JavaScript


Custom JavaScript:

You can run any Javascript before taking a screenshot of the page. Specify the URL of a javascript file to load during your screenshot request. The URL will be loaded just after the page load event. You need to ensure that your script will finish executing before the delay set during the request (current maximum: 10 seconds).

For example, take a screenshot of a full page after scrolling down to the bottom. The script to scroll down is located at http://browshot.com/static/js/custom/scrolldown.js. The script will be loaded and executed within the page after the page load event.

https://api.browshot.com/api/v1/screenshot/create?url=http://www.browshot.com/&instance_id=65&delay=10&script=http://browshot.com/static/js/custom/scrolldown.js&size=page&key=my_api_key

Hide elements on a page (Facebook sign up)

You can use custom JavaScript code to hide or show HTML elements on a page. For example, you can use https://browshot.com/static/js/custom/facebook-hide.js to hide the Facebook sign up page

Without the script:

https://www.facebook.com/nike

With the script:

https://www.facebook.com/nike

Remember than you can host your JavaScript file anywhere.


close

Sign up for a free account