Android Question Javascript

MODERN TALKING

Active Member
Licensed User
Longtime User
Hi guys,

Wanna OPEN a Tab in Chrome - then CLOSE the same Tab

They say it is possible here:

You can only close windows/tabs that you create yourself. That is, you cannot programmatically close a window/tab that the user creates.

For example, if you create a window with window.open() you can close it with window.close().

<scriptsrc="~/Scripts/jquery-1.8.2.js"></script><script>var win;
$(document).ready(function(){var url ='this tab url';
win = window.open(url,'_self');
window.stop();});function closeWindow(){
win.close();}</script>

Then in html

<ahref="javascript:closeWindow();">close</a>

If there are multiple tusk to load then wait some times by this
setTimeout(function(){//do something special//window.stop(); },5000);

Can some kind soul tell me how to morph this Javascript into B4A?

Thank you so much!
 

MODERN TALKING

Active Member
Licensed User
Longtime User
This seems to be the answer - but how to implement in B4A?

Nein sprechen sie Javascript


I think you can only close a tab that was opened using Javascript. like:

function openWin(){
myWindow = window.open("","myWindow","width=200, height=100");// Opens a new window}

function closeWin(){
myWindow.close();// Closes the new window}
 
Upvote 0

MODERN TALKING

Active Member
Licensed User
Longtime User
Thank you Erel

Is it possible to CLOSE CHROME? Activity.Finish perhaps?

There is no "StopActivity(Chrome)" or "CloseActivity(Chrome)?

If I LAUNCH the Chrome browser from my code - can I then CLOSE the entire Browser? How do I FINISH this Activity?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

MODERN TALKING

Active Member
Licensed User
Longtime User
Wunderbar Don. I think for Demo - best is to utilise Webview

You gave a very good suggestion. Thank you so much mein freund
 
  • Like
Reactions: eps
Upvote 0
Top