[英]Cordova Inappbrowser loadstart event determine if the target is blank
Using the cordova inappbrowser loadstart
event is there a way to determine if the link that has been clicked has the target attribute set to blank? 使用cordova inappbrowser loadstart
事件,可以确定单击的链接是否将target属性设置为空白? The reason I want to do this is so that I can divert these URLs to the system browser. 我想要这样做的原因是可以将这些URL转移到系统浏览器。
I am trying to find out what properties the event parameter has. 我试图找出事件参数具有哪些属性。 I am using event.url
but I was hoping there would be an event.target
which would be set to blank. 我正在使用event.url
但我希望将有一个event.target
设置为空白。
app.inAppBrowserRef.addEventListener('loadstart', function (event) {
alert("URL = " + event.url);
alert("Link Target = " + event.target
});
Any help or ideas would be appreciated! 任何帮助或想法,将不胜感激!
I don't believe that there is an "event.target" that has a default property. 我不相信有一个具有默认属性的“ event.target”。 I believe by default the link will open the actual in app browser instead of the device's default. 我相信默认情况下,该链接会打开实际的应用内浏览器,而不是设备的默认浏览器。
To override the default you must specify the target to be '_system': 要覆盖默认值,您必须将目标指定为“ _system”:
var ref = cordova.InAppBrowser.open('http://apache.org', '_system', 'location=no');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.