Use of window.location.href in crosswalk - crosswalk-runtime

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?

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.

Related

CF11 LocalHost 404 Issue

I've just recently installed CF11 on a new machine but I'm encountering the below issue when trying to navigate to the localhost directory in a browser.
On my previous machine which was using CF10 I was able to get the directory listings and navigate through folders to specific pages so is it some setting that I am missing?
I can navigate to CFAdmin okay and have added a whole range of aliases in my server.xml file which I can navigate to, as well as adding the CFIDE and WEB-INF ones.
As an aside, I also seem to get that silly 404 badge in front of CFs debug output when I try and navigate to a page that doesn't yet exist. Is there a way to switch it off?
If you need more details let me know.
Thanks in advance

non-root url not working when directly entered in browser address bar for ember app deployed in Jetty

I have a simple app developed using Ember. It is more of a pet project than anything else. As I am familiar with Jetty, so I just deployed it into Jetty's webapps/ROOT. The problem is, I have to start the app with the root url: http://localhost:8080/. If I enter something like http://localhost:8080/foobar in browser's address bar, I will get a 404. But I can go to that page by clicking some link in the root page.
To my understanding, the reason why directly entering the non-root foobar url not working is that Jetty is trying to locate the foobar resource. Since the foobar resource is only resolvable inside the Ember app, Jetty can't find it and hence it fails to enter non-root url directly. However, my question is, how can I make that directly entered url work? If it can not be done or not easily be done with Jetty, I am open to use another http server.

Ember CLI / browser refresh / production / 404

I developed my webapp using Ember CLI 0.1.15, with emberjs. 1.8.1
I built the app with this command: ember build --environment production , and then I made a WAR out of the files produced under the dist folder of my project, and then I drop the WAR on my tomcat's webapps folder.
So, when I open the app: http://mytomcat/myapp/ ... it went fine, I saw my login screen, I logged in, and navigate around in my app, everythings fine. I could also do the back/forward button, and ember handles the transition well.
But when I click the refresh button on my browser -- the address bar of the browser was showing http://mytomcat/myapp/inventory/ at that moment -- I got 404 reply, from the tomcat.
Then I figured out why it happened: the refresh button sends a request to the tomcat for the path /myapp/myinventory/ ... of course the path /myinventory does not exist on the server. All those routes we see on the browser -- except for the base url, http://mytomcat/myapp/ -- are generated on the client-side.
So, my question is: what's the right way (in ember) to deal with this situation? I need the refresh button to just works. Any way for ember to intercept the refresh button clicked event?
I guess this issues is related to this: https://github.com/stefanpenner/ember-app-kit/issues/486 , but it does not have the answer I need.
Thanks in advance,
Raka
--- UPDATE ---
Probably relevant: http://eviltrout.com/2014/04/10/the-refresh-test.html
Inside config/environment.js file, there is a property called locationType. Set its value to hash
Manually moving files from your /dist folder is time consuming and annoying. Instead, you can specify an output-path property in your .ember-cli with the location inside webapps you are trying to move the files to. Another option is to specify this option to ember server or ember build

Azure Web Job writes files in a website's directory

I attached a Web Job to my Azure website. The webjob prepares a file and I want to save it on a proper folder in the website.
Environment.CurrentDirectory run on the script returns a path under a Temp directory: Temp\jobs\triggered\WEBJOBNAME\q0uwrohv.x5e
I tried to go down on the directory tree:
string path = Path.Combine(Environment.CurrentDirectory, #"..\..\..\..\..\Data")
But it doesn't work:
C:\DWASFiles\Sites\WEBSITENAME\Temp\jobs\triggered\WEBJOBNAME\q0uwrohv.x5e\..\..\..\..\..\Data
How to make and save files from WebJob to a particular path?
I don't want to use blob store.
The path for the root of your Azure Web Site is (usually) d:\home\site\wwwroot.
d:\home is also stored in an environment setting called %HOME%.
To get more insight on the different paths you can use on your site go to:
https://{sitename}.scm.azurewebsites.net, there' you'll have the Debug Console where you can browse through your site and Environment to see all the environment variables you can use.
Your WebJob will have access to the same paths/environment as your Web Site.
For more information on this administration site go to:
http://azure.microsoft.com/blog/2014/03/28/windows-azure-websites-online-tools-you-should-know-about-2/
try the following instead of putting a file location in the value parameter just put this as I show you here
you can do it in the app.config file
add key="app:TempFolderPath" value="~/temp/"/
add key="app:TempReportDirectory" value="~/temp/"/
the web job will automatically put in this location of
D:\local\Temp\jobs\continuous\ImporterWebJob\yex3ad1c.3wo\~\temp\...your file...
I hope this will not give you any errors.

unable to run in server

I have downloaded code from code project site (http://www.codeproject.com/Articles/511031/A-sample-real-time-web-application-using-Ember-js?msg=4693404#xx4693404xx) it is running fine when i run in local but once i keep in server and browse with url it is not opening.
http://drjeppesen.dyndns.org/onlineorder/ser/Ember.n.SignalR/
Displaying empty screen. Can anyone help to find the way how can i run this?
If you see the browser console, your server is requesting the javascripts and css's in the wrong path. For example, a request is made for http://drjeppesen.dyndns.org/onlineorder/Scripts/u.js, but the correct path is http://drjeppesen.dyndns.org/onlineorder/ser/Ember.n.SignalR/Scripts/u.js