aurajs / aura

A scalable, event-driven JavaScript architecture for developing component-based applications.
MIT License
2.94k stars 255 forks source link

External links not working with Android webview #348

Closed SyedWasiHaider closed 9 years ago

SyedWasiHaider commented 9 years ago

Hello,

I am currently putting a web app (written in Aurajs) inside an Android webview. Unfortunately, I am not in control of the web app as it is loaded by an external website. The issue is that I am unable to click on external links. The authors have decided to do someting like this for their tags:

< a href="javascript;void(0)" class="some-random-class" data-aura-rendered-by="blabla"> www.google.com </ a >

The only way I can solve this is by removing any click listeners from this element and attaching my own. Unfortunately, if I do this currently, the listeners already attached will somehow take precedence. Please help.

Thanks

SyedWasiHaider commented 9 years ago

No longer need a solution. Ended up using a really ugly javascript call back hack to get it to work. For those interested:

I used the addJavascriptInterface method for Android webviews and then it called the method inside my javascript interface when the user clicked on the linked. SOO I literally had to do:

var this_is_silly = function() { window.myinterface.dostuff(); } myelement.addEventListener("touch", this_is_silly };

where myinterface is the class type I use above in addJavascriptInterface.