Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues on page with page-scroll : smooth or position: fixed or position: sticky #109

Open
seeforcat opened this issue Jan 13, 2023 · 0 comments

Comments

@seeforcat
Copy link

seeforcat commented Jan 13, 2023

Doesn't work properly on page with page-scroll : smooth;
Doesn't work properly on page with page-scroll : smooth;
Doesn't work properly on page with page-scroll : smooth;

Tip :

document.querySelectorAll('*').forEach(function (element) {
	let style = window.getComputedStyle(element);
	if (style.position === 'sticky' || element.style.position === 'sticky') element.style.setProperty('position', 'static', 'important');
	if (style.position === 'fixed' || element.style.position === 'fixed') element.style.setProperty('visibility', 'hidden', 'important');
	if (style.scrollBehavior === 'smooth' || element.style.scrollBehavior === 'smooth') element.style.setProperty('scroll-behavior', 'auto', 'important');
});

Do save these elements you're modifying into an array so that you can revert it back after taking screenshot or maybe just refresh the page.

Also, change the capture delay to CAPTURE_DELAY for this extension to even work. Chrome API allows only two page screenshots per second so CAPTURE_DELAY of 350 would be sufficient, 350ms + 350ms + 350ms = 1050ms, third screenshot will be out of the 1000ms limit.

I've also completed a single page MV3 port of this extension, will post here soon. In the meantime anyone may contact me at [email protected]
@seeforcat seeforcat changed the title Doesn't work properly on page with page-scroll : smooth, position: fixed, position: sticky Issues on page with page-scroll : smooth or position: fixed or position: sticky Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant