Welcome Guest Search | Active Topics | Sign In | Register

Strange thing with webView.EvalScript Options
rainstuff
Posted: Wednesday, October 19, 2016 6:47:06 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 73
I've got strange thing with EvalScript. If I run
webView1.EvalScript("function CheckClick(num) { return false; } ");

Then I can run
webView1.EvalScript("var a=CheckClick(1)");
And it will be ok.

Thus, function CheckClick() stay in memory after the first call. Is it possible to clean memory from my custom scripts after calling EvalScript?
Eurice
Posted: Wednesday, October 19, 2016 8:18:35 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 137
Hi,

This is pure javascript problem; if you define a function

function CheckClick(num) { return false; }

It will be a function until you navigate to another page.

If you want to remove it just redefine it to be an empty function
function CheckClick(num){}

This is the default behavior for a browser.
rainstuff
Posted: Wednesday, October 19, 2016 9:12:31 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 73
Didn't know that. Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.