Github user hkuiyo commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-inappbrowser/pull/50#discussion_r13853573
--- Diff: src/wp/InAppBrowser.cs ---
@@ -250,6 +251,30 @@ private void ShowCordovaBrowser(string url)
}
}
+ private string FixUrl(string url)
+ {
+ const string IsolatedStorageProtocol = "x-wmapp0:/"; // NOTE:
1 slash, due to paths being screwed up (for example: x-wmapp:/tmp//test.doc,
instead of x-wmapp://tmp/test.doc)
+ string DoubleSeparator =
Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture) +
Path.DirectorySeparatorChar;
+
+ // Remove x-wmapp0 protocol, making this a relative URL,
keeping the original path
+ if (url.StartsWith(IsolatedStorageProtocol,
StringComparison.OrdinalIgnoreCase))
+ {
+ url = url.Substring(IsolatedStorageProtocol.Length);
+ }
+
+ // Replace forward slashes with environment slashes + strip
double slashes
+ url = url.Replace('/', Path.DirectorySeparatorChar);
+ while (url.IndexOf(DoubleSeparator) != -1)
+ {
+ url = url.Replace(DoubleSeparator,
Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture);
--- End diff --
Oops, there should be an extra ) before the ;.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---