nikolaus Member Licensed User Longtime User May 16, 2014 #1 Hi, on both ICS and KK WebView doesn't respond to _LongClick as long as some websites are loading. This allways happens with play.google.com, sometimes with sueddeutsche.de if there are large adds or dynamic elements and never with purely text-based sites. I tried: WebView_LongClick log("LongClick") panelXYZ.Visible = True and definitely Webview doesn't respond to the event until the page has loaded up to a certain point. Seems like some scripts on websites are blocking WebView events during loading or execution. I tried to use Activity_LongClick instead but that doesn't work since WebView consumes the click A transparent panel above the WebView didn't help either. It handles _LongClick well but pass-through of touch and click doesn't work reliable. Any way to force event-handling on WebView no matter what content is loading or beeing displayed? Thx Nikolaus
Hi, on both ICS and KK WebView doesn't respond to _LongClick as long as some websites are loading. This allways happens with play.google.com, sometimes with sueddeutsche.de if there are large adds or dynamic elements and never with purely text-based sites. I tried: WebView_LongClick log("LongClick") panelXYZ.Visible = True and definitely Webview doesn't respond to the event until the page has loaded up to a certain point. Seems like some scripts on websites are blocking WebView events during loading or execution. I tried to use Activity_LongClick instead but that doesn't work since WebView consumes the click A transparent panel above the WebView didn't help either. It handles _LongClick well but pass-through of touch and click doesn't work reliable. Any way to force event-handling on WebView no matter what content is loading or beeing displayed? Thx Nikolaus
NJDude Expert Licensed User Longtime User May 16, 2014 #2 WebViews do not have a Click or Long_Click event. Upvote 0
nikolaus Member Licensed User Longtime User May 16, 2014 #3 NJDude, Any view has any event that exists, they are not documented but are working and may be used safely Erel says. See: http://www.b4x.com/android/forum/threads/using-invalid-events.38124/ WebView_LongClick is working flawsessly as long as there is no active content of some (which?) kind. Thanks anyway Nikolaus Upvote 0
NJDude, Any view has any event that exists, they are not documented but are working and may be used safely Erel says. See: http://www.b4x.com/android/forum/threads/using-invalid-events.38124/ WebView_LongClick is working flawsessly as long as there is no active content of some (which?) kind. Thanks anyway Nikolaus
Erel B4X founder Staff member Licensed User Longtime User May 18, 2014 #4 Any view has any event that exists Click to expand... It is more correct to say that all views have the events of their parent views as well. However there is a reason for the events to be hidden. In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks. Upvote 0
Any view has any event that exists Click to expand... It is more correct to say that all views have the events of their parent views as well. However there is a reason for the events to be hidden. In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks.
nikolaus Member Licensed User Longtime User May 18, 2014 #5 However there is a reason for the events to be hidden. Click to expand... This is why I was asking if it is safe to use those hidden events. In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks. Click to expand... I considered that. However since WebView seems to be only consuming the event during load/execution of some kind of scripts ( and I don't know which) JavaScript injection might be unreliable and/or unpredictable. I will never know if there is a script on some website that interferes with my scripts and every new version of WebView might behave different. If there is no method to enforce event-handling independently of what WebView is loading or displaying it does not make sense to use that event. I will implement my ideas another way. Upvote 0
However there is a reason for the events to be hidden. Click to expand... This is why I was asking if it is safe to use those hidden events. In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks. Click to expand... I considered that. However since WebView seems to be only consuming the event during load/execution of some kind of scripts ( and I don't know which) JavaScript injection might be unreliable and/or unpredictable. I will never know if there is a script on some website that interferes with my scripts and every new version of WebView might behave different. If there is no method to enforce event-handling independently of what WebView is loading or displaying it does not make sense to use that event. I will implement my ideas another way.