How to prevent OpenNewWindow Event


Tinn Aphopchung

I have a question.In your googlemap sample.It use IFrame to show a map.But if user click some link in "Iframe".It will open new window.How to prevent it from open new window browser?(Take no action at click or open in IFrame)


DecSoft

Hello tin,

In principle, a link in an "iframe" are opened in the same iframe, except if the link have the "target='_blank'" attribute. In this case the link are opened in a new window or browser tab. I try with the "Show larger map" link which appear in the Google Maps sample and, in my phone, the link is simply ignored (?).

Certainly I am not quite sure how to proceed. Maybe we can try to search a way in order to tell the map to don't show that link. This can be the best possible solution, but I don't know if it possible tin... This things happend when we uses certain thirdparty services. In other words, if we use own our iframe contents, then we can take care about what exactly is shown and how the links are opened.

Sorry if I can't tell you more at this time.



Tinn Aphopchung

Thanks for answer,David.If It cannot,then I will try another plugin
https://github.com/mapsplugin/cordova-plugin-googlemaps

Ps.Will made another sample for everyone too.


DecSoft

Hello,

Yes; another possible way is to use another API instead the "Embedded" one. Apparently the plugin you mentioned uses a more complete API, then probably we can control a little more what appear in the map. If you need any help, please, post it here or open a new forum's thread tin. Ok?



Tinn Aphopchung

Ok.Close this topic I will upload it in new thread when I finish.Thanks


DecSoft

No problem. :)



Tinn Aphopchung

Again,Can we detect event that show OpenNewwindow?


DecSoft

Hello,

Sorry, can you explain a little more about tin?



Tinn Aphopchung

I mean,Did we have any event that will detect if new browser window have show?


DecSoft

Hello,

If the window is opened by certain "link" (like the Google Map's one) then I don't know any way to be advised when the window is opened. Only if we open an HTML page in another window, we can use the "load" event, for example, but probably this is not what you wanted right now...



Tinn Aphopchung

Ok.Thanks for answer,David.

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.