Webview - External CSS

187 views
Skip to first unread message

Shane Thompson

unread,
Nov 10, 2015, 11:48:01 AM11/10/15
to Tasker
Hello,

I'm attempting to create my own little front end (minimal experience in Web Development) using Tasker's built-in Webview Element and Scenes. I seem to be having an issue with "refreshing" CSS content. 

I use an external app called "FolderSync" and it allows me to use it's plugin to sync files and folders from Google Drive to my device. (I can confirm this app has nothing to do with the issue as I'm currently using it for other js functions)

html sync: /sdcard/Tasker/Scripts/default.html
css sync: /sdcard/Tasker/Scripts/styles.css

HTML Code: (testing capabilities, so no real information)

<!doctype html>

<html lang="en">
<head>
<title>Tasker Webview</title>
<link rel="stylesheet" type="text/css" href="/sdcard/Tasker/Scripts/WebSite/styles.css">
</head>
    <body>
    <div class="box">
    <h1>This is a TEST</h1>
    </div>
    </body>
</html>

Css:

body {
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
    background-color: #FFF;
}

.box {
    color: green;
}


I'll change the text color in class box, and the Webview "appears" to be caching information some how as it doesn't update unless I change the path to the css file in the html document. I've searched some simple force refresh css on reload, and they do not help.

Any information would be great. 

Tasker version: 4.7u3m
Android Version: 5.1.1 





Lorenzo

unread,
Nov 11, 2015, 5:41:07 AM11/11/15
to Tasker
I don't know if can help but also changing the HTML code not refresh.
I read elsewhere that you have to exit from tasker (I mean all scenes and also notifications not the application) and then re-opening the scene the new code is applied.
I tryied for HTML and it works, not sure for CSS but I would like to have the answer too.
I'm trying to write and interface with HTML5 and scenes and if also CSS works ths would help.

Shane Thompson

unread,
Nov 11, 2015, 9:36:48 AM11/11/15
to Tasker
Lorenzo,

Thanks for the input. 

What I do as far as HTML goes is in my task I have both a Show Scene (Dialog for now), then a Destroy Scene. I think in the Show Scene I had to uncheck "Continue Immediately". 
This seems to grab the updated HTML code. 

I just can't figure out why the WebView and/or Tasker is holding old CSS in memory. I've even deleted the CSS file that the HTML references and still shows old CSS.
Sometime's when I give a bad absolute CSS reference, run it, change it back I can get an update... But even then it seems hard to duplicate...
Reply all
Reply to author
Forward
0 new messages