You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However when index.html is loaded from cordova hybrid app for following href
"file:///Users/kpraveen/Library/Developer/CoreSimulator/Devices/8336AC80-5CE3-4E95-BEDE-34667F0F845D/data/Containers/Bundle/Application/AA8F812B-2B08-41D9-A11C-F0E82B3B6193/HelloWorld.app/www/elements/abcd"
url.origin will be "null"
Due to this, when following check is performed
origin will be "file://", and url.origin will be "null"
if (url.origin !== origin) {
return null;
}
it will be treated as different origin, although origin is same.
This causes app-location, app-route to fail.
Tested in ios simulator on mac.
Expected outcome
if current and linked url both are from file:// it should be treated as same origin always and location-changed event must be fired.
Actual outcome
if current and linked url both are from file:// it is treated as cross origin so location-changed event is not fired.
The text was updated successfully, but these errors were encountered:
pkgulati
changed the title
location-changed event not fired in case of file:// protocol in case of mobile hybrid app.
location-changed event not fired in case of file:// protocol for mobile hybrid app.
Nov 11, 2016
Description
To check whether the href origin and current origin is same or not, URL constructor is being used.
URL constructor is behaving correctly for http:, but not for file: protocol
var url = new URL("http://google.com")
url.origin will be http://google.com
However when index.html is loaded from cordova hybrid app for following href
"file:///Users/kpraveen/Library/Developer/CoreSimulator/Devices/8336AC80-5CE3-4E95-BEDE-34667F0F845D/data/Containers/Bundle/Application/AA8F812B-2B08-41D9-A11C-F0E82B3B6193/HelloWorld.app/www/elements/abcd"
url.origin will be "null"
Due to this, when following check is performed
origin will be "file://", and url.origin will be "null"
if (url.origin !== origin) {
return null;
}
it will be treated as different origin, although origin is same.
This causes app-location, app-route to fail.
Tested in ios simulator on mac.
Expected outcome
if current and linked url both are from file:// it should be treated as same origin always and location-changed event must be fired.
Actual outcome
if current and linked url both are from file:// it is treated as cross origin so location-changed event is not fired.
The text was updated successfully, but these errors were encountered: