diff --git a/src/printer.js b/src/printer.js
index c181f592af611e671cd8a71fdddc40dda7808670..b7ea0102c15c32e9398577c67fe67f18166e4376 100644
--- a/src/printer.js
+++ b/src/printer.js
@@ -74,7 +74,12 @@ class Printer extends EventEmitter {
         url = input;
       } catch (error) {
         relativePath = path.resolve(dir, input);
-        url = "file://" + relativePath;
+
+        if (this.browserWSEndpoint) {
+          html = fs.readFileSync(relativePath, 'utf-8')
+        } else {
+          url = "file://" + relativePath;
+        }
       }
     } else {
       url = input.url;