facepaste
facepaste copied to clipboard
doesn't work when third party cookies are not accepted
If cookies are accepted (which is required for Facebook to be able to log in) but third party cookies are not, the photo page requests initially receive a "Content unavailable" page, and regex matching against this page for the image URL fails.
Viewing the source of a photo page, we can see that its source is always a "Content unavailable" page at first, but reloading the source causes the correct page to be sent.
This could probably be fixed simply by requesting the photo page twice each time and using the source from the second request, obviously at the expense of speed.
Requesting the photo page twice each time does not help.
Tested code was to replace the handle_page function definition with:
function handle_page(res, req, pi) {
ajax(album[pi].pageurl, false, '', handle_page_real, pi);
}
function handle_page_real(res, req, pi) {
progress(pi, 'downloading');
album[pi].imageurl = res.match(
/<a class="fbPhotosPhotoActionsItem" href="([^"]+)" rel="ignore">/
)[1];
ajax(album[pi].imageurl, true, '', handle_image, pi);
}