MozillaZine

[EXT] Screengrab!

Announce and Discuss the Latest Theme and Extension Releases.
pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 9th, 2017, 9:34 am

rthx wrote:when save to file, where can I select .png or .jpg as in version 0.99?
I only found this in settings.
Not possible to select on saving?

Image

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 9th, 2017, 1:06 pm

rthx wrote:when save to file, where can I select .png or .jpg as in version 0.99?
...
Not possible to select on saving?

You cannot select on the fly and I don't recall that ever being a function but you can select as shown under settings and there is really no reason to jump back and forth between them at random anyway.
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

akn17
 
Posts: 1
Joined: October 10th, 2017, 3:06 am

Post Posted October 10th, 2017, 3:18 am

I'm using screengrab to save the complete pages, "Click to icon..." is set accordingly. Since version 2.4 the "save as..." dialogue always displays the download folder at first. In the old version screengrab reminded the folder at the second time. Now with every screenshot I have to choose the folder for saving again.

pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 10th, 2017, 4:40 am

akn17 wrote:I'm using screengrab to save the complete pages, "Click to icon..." is set accordingly. Since version 2.4 the "save as..." dialogue always displays the download folder at first. In the old version screengrab reminded the folder at the second time. Now with every screenshot I have to choose the folder for saving again.

Sorry, this limitation of WebExtensions
WebExtensions does not have an API to pre-select a directory :(

docs:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/download

and there are no other methods for saving:
https://bugzilla.mozilla.org/show_bug.cgi?id=1246236#c81

wiki:
Engineering Plan: Not planned
These might be possible, but are too large to reasonably commit too and have too many unanswered security and usability questions:
Writing outside the downloads directory
https://wiki.mozilla.org/WebExtensions/Filesystem#Choosing_location_in_the_downloads_directory
https://wiki.mozilla.org/WebExtensions/Filesystem#Writing_outside_the_downloads_directory

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 10th, 2017, 10:50 pm

Here is an example of a page that cannot be full page captured, it will only capture visible section: mariemcdonald.ew.com
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 12th, 2017, 5:43 am

version 2.5
https://addons.mozilla.org/addon/screengrab-fix-version/
https://chrome.google.com/webstore/detail/screengrab/fccdiabakoglkihagkjmaomipdeegbpk

changes:
added: "Complete Page (forced mode)" for capture the pages created with div layers,
example: https://foxdns.pro/ , https://www.nab.com.au/ , http://mariemcdonald.ew.com/, etc
"forced mode" uses a complicated algorithm and in some cases, the browser may be temporarily slowed down

added: Settings - "Capture page: always use only «forced option»"
fixed: minor bug fixes

TonyK73
 
Posts: 2
Joined: February 3rd, 2008, 8:11 am

Post Posted October 12th, 2017, 10:42 am

Any plans to allow copy to Clipboard in the Chrome version of Screengrab!? Currently the only way to get it in the clipboard that I found is to save a JPG to a file, then open it in another app, then copy from that app, then delete the file. I would much prefer to have it in the Clipboard natively.

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 12th, 2017, 11:39 am

pag77 wrote:version 2.5
https://addons.mozilla.org/addon/screengrab-fix-version/
https://chrome.google.com/webstore/detail/screengrab/fccdiabakoglkihagkjmaomipdeegbpk

changes:
added: "Complete Page (forced mode)" for capture the pages created with div layers,
example: https://foxdns.pro/ , https://www.nab.com.au/ , http://mariemcdonald.ew.com/, etc
"forced mode" uses a complicated algorithm and in some cases, the browser may be temporarily slowed down

added: Settings - "Capture page: always use only «forced option»"
fixed: minor bug fixes

Thank you, I will give that a go and let you know how it goes. Well done, I am optimistic.
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 12th, 2017, 11:56 am

Ok, result. It DID capture the whole page, well done on that. However, it didn't include everything. I tried doing an upload so you can see for yourself but encountered a couple of issues. 1) While it is uploading and you are updating the percentage, it flickers so badly that you can barely see the notification. 2) After all that, it came back and failed saying ERROR but providing no more insight as to why/what and so on. Changing "upload provider" didn't resolve the issue either, simply fails. I suppose it might be the size (height) or whatever of the image that is causing, but I am just making an educated guess at this point.

Now I went ahead and posted the local captured file so you can see, and by comparing it to the actual page, maybe figure out what if anything went wrong with the "algorithm" and adjust accordingly, but we are off to a promising start. One side note, if possible make the forced/regular captures two separate options, so it is not an all or nothing situation, so a person can do regular capture and if something goes wrong, THEN choose the forced without having to keep going back to settings to check/uncheck that option. Just a thought from a UX perspective.

The image is very "long" so for the sake of not taking too much screen space in the thread, I am linking instead of putting it inline. Sample, let me know if you need anything else.
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 12th, 2017, 1:02 pm

TonyK73 wrote:Any plans to allow copy to Clipboard in the Chrome version of Screengrab!? Currently the only way to get it in the clipboard that I found is to save a JPG to a file, then open it in another app, then copy from that app, then delete the file. I would much prefer to have it in the Clipboard natively.

Sorry, but Chrome API not supported copy image to clipboard
workaround: use the "preview" mode, then right click on the image and select "copy"

GµårÐïåñ wrote:Ok, result. It DID capture the whole page, well done on that.

I did a lot of tests and did not find a universal solution.
if adjust the algorithm for the exact capture of one site, then there is no capture of another site and vice versa.
in the end, I left a single universal solution - now captures all sites but there may be minor differences from the original
agree - it's better than capturing just a visible area like it was before version 2.5

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 12th, 2017, 2:47 pm

pag77 wrote:I did a lot of tests and did not find a universal solution.

I know, it's a bit of a bitch, I will give you that much. Take a look at this html2canvas for some inspiration and see if you can get some ideas form the library to help you. Also, pages created using frameworks like Angular tend to be finicky and hard to even print, let a lone capture. The above library will help with that but there are also print directives you can take a look at and see how they alleviate some of this issue for ideas, such as this one Angular Print Directive.

pag77 wrote:if adjust the algorithm for the exact capture of one site, then there is no capture of another site and vice versa.
in the end, I left a single universal solution - now captures all sites but there may be minor differences from the original
agree - it's better than capturing just a visible area like it was before version 2.5

I understand and agree, you don't want to make site specific solutions but you might consider detecting and using framework specific solutions, so that you can use the method which best works with each type of site that uses div based segmentation and modify your algorithm to parse them based better on the modulation of the implementation of the site, rather than making it site specific, see what I mean? It shouldn't be too difficult to "sniff" the framework being used.

Alternatively, you are right, better than capturing visible area, but as a fail safe, you can also provide the stitching option, so that basically scroll to the top 0,0 and then capture visible, scroll precisely to the next visual segment, capture and ultimately stitch them together to get the full page frame. That is a feasible alternative as well. Just don't forget that the tail end might be shorter than the visible area height, so take that last part into account by calculating the difference so you can scroll to the last segment without having an overlap capture during the stitch or extra whitespace at the bottom. Let me know if you have anything you want me to help you test before releasing.
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 12th, 2017, 4:12 pm

GµårÐïåñ wrote:I know, it's a bit of a bitch, I will give you that much. Take a look at this html2canvas for some inspiration and see if you can get some ideas form the library to help you. Also, pages created using frameworks like Angular tend to be finicky and hard to even print, let a lone capture. The above library will help with that but there are also print directives you can take a look at and see how they alleviate some of this issue for ideas, such as this one Angular Print Directive.


Have you seen the number of sources? I will be read a year to understand them...

GµårÐïåñ wrote:I understand and agree, you don't want to make site specific solutions but you might consider detecting and using framework specific solutions, so that you can use the method which best works with each type of site that uses div based segmentation and modify your algorithm to parse them based better on the modulation of the implementation of the site, rather than making it site specific, see what I mean? It shouldn't be too difficult to "sniff" the framework being used.

Alternatively, you are right, better than capturing visible area, but as a fail safe, you can also provide the stitching option, so that basically scroll to the top 0,0 and then capture visible, scroll precisely to the next visual segment, capture and ultimately stitch them together to get the full page frame. That is a feasible alternative as well. Just don't forget that the tail end might be shorter than the visible area height, so take that last part into account by calculating the difference so you can scroll to the last segment without having an overlap capture during the stitch or extra whitespace at the bottom. Let me know if you have anything you want me to help you test before releasing.


I tried this method but it did not work.
if the site is built on layers, then first you need to find the desired layer for scrolling.
in addition, it will not be possible to sew exactly, since there are always elements that are fixed in certain places.

in fact, there are not so many problematic sites, so I suggest leaving my algorithm as is and making corrections only if it does not work on any site

sorry, but I have very little time to discuss these non-critical issues - I need to redesign another my addon before the release of Firefox 57

GµårÐïåñ

User avatar
 
Posts: 203
Joined: March 26th, 2008, 1:43 pm
Location: Area 51.2

Post Posted October 12th, 2017, 4:41 pm

pag77 wrote:Have you seen the number of sources? I will be read a year to understand them...

Yes, the codebase is extensive but you don't have to look at or understand all of it, just what is relevant to you and that would begin with this html2canvas.js and once you identify the part that is relevant to you, then you look at any other function files that support it.

I tried this method but it did not work.
if the site is built on layers, then first you need to find the desired layer for scrolling.
in addition, it will not be possible to sew exactly, since there are always elements that are fixed in certain places.

Yeah that is not the best way, hence why called failsafe but keep in mind you are not scrolling the layers, you are scrolling the rendered dom canvas, so that will respond to the scroll function regardless of layers. But anyway, the "sewing" is each visible capture, not the actual page content you are taking a shot of, that's a simply binary assembly.

in fact, there are not so many problematic sites, so I suggest leaving my algorithm as is and making corrections only if it does not work on any site

actually there are, as with any millions of sites using Angular where your solution won't work. The more people shift from static HTML, the more your solution will fail but if you want to wait for that happen to do something, that's certainly your choice. This is an example of where it is not working but you want to keep it as-is anyway, so kind of speaking in contradiction if you realize.

sorry, but I have very little time to discuss these non-critical issues - I need to redesign another my addon before the release of Firefox 57

A screen grabbing extension unable to do it is hardly a trivial or non-critical issue but if that's your estimation then by all means don't fix it and focus on something else. Good luck.
Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k

rthx
 
Posts: 2
Joined: October 9th, 2017, 2:58 am

Post Posted October 13th, 2017, 6:03 am

GµårÐïåñ wrote:... and I don't recall that ever being a function but you can select as shown under settings and there is really no reason to jump back and forth between them at random anyway.


This is the case in version 0.99.
Image -> https://picload.org/view/dgiiawla/screenshot_select_png_jpg_2017.png.html

Depending on the webpage is saved by me in PNG or JPG.
Very awkward every time in the settings to change that.

pag77
 
Posts: 1338
Joined: December 26th, 2013, 10:46 pm

Post Posted October 13th, 2017, 6:21 am

rthx wrote:
GµårÐïåñ wrote:... and I don't recall that ever being a function but you can select as shown under settings and there is really no reason to jump back and forth between them at random anyway.


This is the case in version 0.99.
Image -> https://picload.org/view/dgiiawla/screenshot_select_png_jpg_2017.png.html

Depending on the webpage is saved by me in PNG or JPG.
Very awkward every time in the settings to change that.

unfortunately WebExtensions no longer gives such an opportunity.
but I can try search for a workaround - if you change the file extension by hand: then Screengrab must perform the reformatting of the image...

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 4 guests