1

I use crosswalk 5.34.104.5 to build Android app.

After executing

location.href = '/another_page.html'

in index.html, which is a entry point defined by manifest.json, empty alert pops up and blank page appears.

another_page.html is located in the same directory as index.html (i.e. it is in apk file whose path is assets/www/another_page.html relative to apk's root) and is not served over network.

How can I achieve intended location transition?

yskkin
  • 854
  • 7
  • 24

1 Answers1

2

It is a typo in "asserts/www/another_page.html", it should be assets, right? I can do the same thing with changing location.href to load another page.

EDIT: If you are using make_apk.py to package your app, you can pass "--enable-remote-debugging" to turn on remote debugging for your app. Once the app is launched on your device, open 'chrome://inspect' in Chrome browser running on the host machine, and inspect the page to directly execute "window.location.href=xxx" in console, and try to fix your problem. See https://crosswalk-project.org/#wiki/Remote-Debugging-on-Android for details.

Bob
  • 66
  • 4
  • It was a typo. I edited it. If I set `location.href="file:///android_asset/www/another_page.html"`, it worked. But, Do I really have to set `location.href` in this way? it's a bit messy. – yskkin Jun 10 '14 at 05:33
  • Ok, `location.href="another_page.html"` works. absolute path seems to case some trouble. – yskkin Jun 10 '14 at 05:39
  • Alternatively, you can try to set "location.href=/www/another_page.html" instead. – Bob Jun 10 '14 at 07:21