ubrowser: Add support for file URI scheme
authorMichał Pakuła vel Rutka <m.pakula@samsung.com>
Thu, 26 Feb 2015 07:48:18 +0000 (08:48 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Currently ubrowser converts all URLs 'http://' with exception of ones
starting '/', 'http' and 'about'. This commit adds an exception for adresses
starting with 'file' or 'https' so they won't be converted to 'http://'
Reviewed by: Antonio Gomes, Piotr Grad, Piotr Tworek, Tomasz Weglarski

Change-Id: I537a21a882abca76bbc4e0ef7bc1c369bd9d7ec9
Signed-off-by: Michał Pakuła vel Rutka <m.pakula@samsung.com>
tizen_src/ewk/ubrowser/window.cc

index 2b65d9f..bc00e32 100644 (file)
@@ -99,11 +99,15 @@ Window::~Window() {
 }
 
 void Window::LoadURL(std::string url) {
-  const static std::string http = "http";
+  const static std::string http = "http://";
+  const static std::string https = "https://";
+  const static std::string file = "file://";
   const static std::string about = "about:";
   if (url.compare(0, 1, "/") == 0) {
     url = "file://" + url;
   } else if (url.compare(0, http.length(), http) != 0 &&
+      url.compare(0, https.length(), https) != 0 &&
+      url.compare(0, file.length(), file) != 0 &&
       url.compare(0, about.length(), about) != 0) {
     url = "http://" + url;
   }