Closed ylazy closed 2 years ago
Update: Switching to another tab when the current tab is loading causes errors:
_webView.currentTab = _tabAIndex;
_webView.load(new URLRequest(_targetURL));
_webView.currentTab = _tabBIndex;
Expected result: tab A will load the _targetURL. Actual result: tab B load the _targetURL.
_webView.currentTab = _tabAIndex;
_webView.load(new URLRequest(_targetURL));
this.addEventListener(Event.ENTER_FRAME, onNextFrame);
function onNextFrame(e:Event):void
{
this.removeEventListener(Event.ENTER_FRAME, onNextFrame);
_webView.currentTab = _tabBIndex;
}
Expected result: tab A will load the _targetURL. Actual result: tab A and tab B load the _targetURL.
Is there any way to evaluateJavascript/callJavascriptFunction/addCallback/reload/reloadFromOrigin/removeCallback/stopLoading on a tab that is not the current tab?
No. All operations are done only on the web view visible to the user, ie the selected "tab"
Re: tabs. I am not able to reproduce. If I use the sample project and load tab 2 then enter a new url with the following code. Everything works as expected
private function onUrlEnter(event:Event):void {
webView.currentTab = 0;
webView.load(new URLRequest(urlInput.text));
webView.currentTab = 1;
tabBar.setActiveTab(1);
}
Have you read the Wiki carefully?
What version of the product are you using?
On what operating system?
If Windows is the AIR app 32bit or 64bit**?
Which IDE are you using?
Which version of AIR are you using?
What steps will reproduce the problem?
For example, I have 2 tabs: tab A and tab B, the current tab is tab A (_webView.currentTab = _tabAIndex). I need to evaluateJavascript on tab B but don't want to switch to tab B, something like that:
_webView.evaluateJavascript(code, _tabBIndex); // eval the code on tab B
Currently, I have to switch to tab B then eval the code then switch back to tab A:I don't know if I missed something. Please help, Thank you!
By the way, thank you for giving us a great ANE.