2

I have seen this excellent firefox extension, Screengrab!. It takes a "picture" of the web page and copies it to the clipboard or saves it to a png file. I need to do so, but with a new web page, from an url I have in javascript. I can open the web page in a new window, but then I have to call the extension -not to press the control- and saves the page once the page is fully loaded.

Is it possible?

2 Answers 2

1

I am pretty certain that it is not possible to access any Firefox add-on through web page content. This could create privacy and/or security issues within the Firefox browser (as the user has never given you permission to access such content on their machine). For this reason, I believe Firefox add-ons run in an entirely different JavaScript context, thereby making this entirely impossible.

However, as Dmitriy's answer states, there are server-side workarounds that can be performed.

Sign up to request clarification or add additional context in comments.

1 Comment

How about modifying the add-on to listen to some event that we can dispatch from the web content?
0

Does not look like ScreenGrab has any javascript API.

There is a PHP solution for Saving Web Page as Image.

If you need to do it from JavaScript (from client side) - you can:

Step 1: Create a PHP server app that does the trick (see the link), and that accepts JSONP call.

Step 2: Create a client side page (JavaScript) that will send a JSONP request to that PHP script. See my answer here, that will help you to create such request.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.