Browse Source

fix: default_app incorrect loading by url (#14940)

Shelley Vohr 6 years ago
parent
commit
47258f7b3d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      default_app/main.js

+ 5 - 1
default_app/main.js

@@ -155,7 +155,11 @@ if (option.file && !option.webdriver) {
   if (protocol === 'http:' || protocol === 'https:' || protocol === 'file:' || protocol === 'chrome:') {
     loadApplicationByUrl(file)
   } else if (extension === '.html' || extension === '.htm') {
-    loadApplicationByUrl('file://' + path.resolve(file))
+    loadApplicationByUrl(url.format({
+      protocol: 'file:',
+      slashes: true,
+      pathname: path.resolve(file)
+    }))
   } else {
     loadApplicationPackage(file)
   }