Recent Android Webview update breaks Javascript in Tasker

589 views
Skip to first unread message

Tony

unread,
Apr 2, 2015, 9:59:16 PM4/2/15
to tas...@googlegroups.com
I have a tasker task that uses javascript to perform some operations based on certain conditions.  Recently my task stopped working for no reason, I could even take the same javascript code and run it on my computer and it works great.

What I found was the recent update of Android Webview on March 30, 2015 has impacted my javascript task in some way.  I was able to prove this by uninstalling Android Webview and my javascript task worked flawlessly.

My setup:
Nexus 5 on 5.1
Tasker 4.6u3m

Pent

unread,
Apr 3, 2015, 3:16:28 AM4/3/15
to tas...@googlegroups.com
Just installed 5.1 this morning, will get back to you after testing.

Pent

Pent

unread,
Apr 3, 2015, 5:34:30 AM4/3/15
to tas...@googlegroups.com
I installed the latest WebView from Google Play and tested a script without problem.

Could you please post the exported XML of the task with the script (please simplify as much
as possible first...)

Pent

Tony

unread,
Apr 3, 2015, 4:48:41 PM4/3/15
to tas...@googlegroups.com
Sorry for late response I have been at work all day.  The only thing I can figure is that I am doing synchronous XMLHttpRequest requests and maybe the newer webview has completely deprecated those types of calls.

I can't provide you my current JS file since its basically just communicating with my home computer, but I will see if I can put together an example piece of code that reproduces the issue. 

Pent

unread,
Apr 6, 2015, 3:10:01 AM4/6/15
to tas...@googlegroups.com

Sorry for late response I have been at work all day.  The only thing I can figure is that I am doing synchronous XMLHttpRequest requests and maybe the newer webview has completely deprecated those types of calls.

Well if that's the case, I don't think there's anything I can do about it, I have no influence over what's provided in the WebView environment. Perhaps
it's available via an external library you could include (I'm not a JS programmer BTW....)

Pent

Tony Meszaros

unread,
Apr 6, 2015, 9:41:58 AM4/6/15
to tas...@googlegroups.com
I was actually able to test the synchronous XMLHttpRequest item by making a simple test a weather API I found.  Tasker and the updated Webview item appeared to still work with the simple example.

I sent you the task xml you requested privately.  Let me know if I need to send it again.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/NFQhT1akldo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Pent

unread,
Apr 6, 2015, 10:01:37 AM4/6/15
to tas...@googlegroups.com

I was actually able to test the synchronous XMLHttpRequest item by making a simple test a weather API I found.  Tasker and the updated Webview item appeared to still work with the simple example.

Then what's not working ?

Best plan would be you pare your script down till you find out what's not working.

Pent

Pent

unread,
Apr 13, 2015, 4:51:19 AM4/13/15
to tas...@googlegroups.com
You sent me the task but not the script.

Pent

Tony

unread,
Apr 16, 2015, 8:31:08 AM4/16/15
to tas...@googlegroups.com
Sorry for the delay. Here are the JS files.
BlueIris.js
md5.js

Pent

unread,
May 4, 2015, 8:02:48 AM5/4/15
to tas...@googlegroups.com
Thanks, and sorry for the delay.

There are two things going on.

1) a bug in Tasker where a warning from the JS engine caused script execution to stop
2) this warning from the engine: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

Pent

Pent

unread,
May 4, 2015, 9:35:06 AM5/4/15
to tas...@googlegroups.com
p.s. JS warning bug fixed in latest beta I just uploaded (see top of forum sticky)

Pent
Reply all
Reply to author
Forward
0 new messages