{"action":"created","issue":{"url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/6","labels_url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/6/comments","events_url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/6/events","html_url":"https://github.com/miketaylr/fennec-url-screenshots/issues/6","id":93260538,"number":6,"title":"Feature req: check if body is visible before screenshot","user":{"login":"hallvors","id":120136,"avatar_url":"https://avatars.githubusercontent.com/u/120136?v=3","gravatar_id":"","url":"https://api.github.com/users/hallvors","html_url":"https://github.com/hallvors","followers_url":"https://api.github.com/users/hallvors/followers","following_url":"https://api.github.com/users/hallvors/following{/other_user}","gists_url":"https://api.github.com/users/hallvors/gists{/gist_id}","starred_url":"https://api.github.com/users/hallvors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hallvors/subscriptions","organizations_url":"https://api.github.com/users/hallvors/orgs","repos_url":"https://api.github.com/users/hallvors/repos","events_url":"https://api.github.com/users/hallvors/events{/privacy}","received_events_url":"https://api.github.com/users/hallvors/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-06T11:53:07Z","updated_at":"2015-07-06T14:07:30Z","closed_at":null,"body":"Just a suggestion: I've run into sites that try to avoid FOUC-like effects by setting BODY to display:none until the content is loaded and they feel \"ready\".\r\n\r\nRight now the addon's strategy for taking screenshot is: wait for the load event, then wait another 5 seconds, if document.body doesn't exist give up.\r\n\r\nMy suggestion: wait for the load event, then wait 5 seconds, check if the body exists and if its computed 'display', 'visibility' and 'opacity' styling indicates it's visible, then take screenshot. If the test fails, try once more after 5 seconds before giving up.\r\n\r\n\"wait 5 seconds after load\" is implemented here:\r\nhttps://github.com/miketaylr/fennec-url-screenshots/blob/master/bootstrap.js#L200\r\ndocument.body check is here:\r\nhttps://github.com/miketaylr/fennec-url-screenshots/blob/master/bootstrap.js#L262"},"comment":{"url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/comments/118866477","html_url":"https://github.com/miketaylr/fennec-url-screenshots/issues/6#issuecomment-118866477","issue_url":"https://api.github.com/repos/miketaylr/fennec-url-screenshots/issues/6","id":118866477,"user":{"login":"miketaylr","id":67283,"avatar_url":"https://avatars.githubusercontent.com/u/67283?v=3","gravatar_id":"","url":"https://api.github.com/users/miketaylr","html_url":"https://github.com/miketaylr","followers_url":"https://api.github.com/users/miketaylr/followers","following_url":"https://api.github.com/users/miketaylr/following{/other_user}","gists_url":"https://api.github.com/users/miketaylr/gists{/gist_id}","starred_url":"https://api.github.com/users/miketaylr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miketaylr/subscriptions","organizations_url":"https://api.github.com/users/miketaylr/orgs","repos_url":"https://api.github.com/users/miketaylr/repos","events_url":"https://api.github.com/users/miketaylr/events{/privacy}","received_events_url":"https://api.github.com/users/miketaylr/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T14:07:30Z","updated_at":"2015-07-06T14:07:30Z","body":"@hallvors that's a great suggestion. \r\n\r\nWithout having paid too much attention, I've seen at least a handful of \"blank\" results from a list of 100 or so sites."}}