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

The source disappears after scrolling multiple times in the Windows app. #2377

Open
2 tasks done
Munhun opened this issue Oct 28, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Munhun
Copy link

Munhun commented Oct 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In the Windows app, scroll to the end of the page and click on the element that opens a new window.
But it doesn't respond at all. (The first few times it succeeds.)
Scroll up again to see the erased screen.
The sauce has disappeared.
And I can't do anything.

Expected Behavior

A new page must be opened.
Other JavaScript operations must be available.

Steps with code example to reproduce

flutter code ---
controllerNaver!.evaluateJavascript(source: 'scrollPage(0);');
~~~
controllerNaver!.evaluateJavascript(source: 'test();');
~~~

=======
javascript code ---

function scrollPage(tabNumber, condClass='') {
	let scrollStep = 1000;
        console.log(tabNumber);
        console.log(condClass);
	function step() {
		if (condClass != ''){
			const paginationElement = document.querySelector(condClass);
			if (paginationElement) {
         console.log('startCrawler ... ' + tabNumber);
				sendFlutterMessage('startCrawler', { 'tab': tabNumber });
				return;
			}
		}
		console.log('scrollTop');
		const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
		const scrollHeight = document.documentElement.scrollHeight;
		const clientHeight = document.documentElement.clientHeight;
		
		window.scrollBy({ top: scrollStep});
		
		if (scrollTop + clientHeight < scrollHeight - 200) {
			requestAnimationFrame(step);
		} else {
			sendFlutterMessage('startCrawler', { 'tab': tabNumber });
		}
	}
	requestAnimationFrame(step);
}

function test(){
   ~~~
   const link = item.querySelector('a');
   link.click();
}

Stacktrace/Logs

Stacktrace/Logs

image

Flutter version

v 3.24.3

Operating System, Device-specific and/or Tool

Windows 10 Pro

Plugin version

v6.1.5

Additional information

No response

Self grab

  • I'm ready to work on this issue!
@Munhun Munhun added the bug Something isn't working label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant