cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <>
Subject I want to help on jira issue CB-4421: WP8 Project - XHRHelper.HandleCommand failing with 'System.InvalidOperationException: This operation is not supported for a relative URI" error
Date Wed, 21 Aug 2013 14:03:49 GMT
I started working on root cause, and potential fix.

There are multiple extra things I found working on this issue:

1. Use should not need to specify 'www' or '/www/' or '//www' in the path
for a relative path like
User should be able to do this $.get("folder/to/devConfig.txt") assuming
folder is a the same directory as index.html (Context root)
What this means is that for other platforms (web, ios, android, etc..)
specifying 'folder/to/devConfig.txt' works, but for wp8 it doesn't user
will need to append the 'www/' this breaks the whole thing about coding for
the web once and run everywhere

2. Is user wants to access a file locally and is not relative to or inside
'www/' then it needs to use the File Plugin, for example accessing a file
at the app root same level as 'www' or higher

3. We should provide a fix and not be jerks and break old code and try to
detect if user specifies '//www/folder..' or 'www/folder..' or 'folder/'
'file.txt' and still work fine and read the relative file. but maybe
putting a console log suggesting to users that proper way will be 'folder/'
or 'file.txt' they should not worry about the name 'www' since it could be
specified in config.xml

4. I'm not familiar on how the response is handle back using
InvokeScript("__onXHRLocalCallback" it doesn't look unique like a unique
callback id it looks like a single global for all responses, and might
cause issues with async calls. I think I will need help on this one from
wp8 experts and maybe log it under a different jira issue


Carlos Santana

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message