Browse Source

chore: make crash-reporter specs not use URL module (#16850)

trop[bot] 6 years ago
parent
commit
c65e9079cc
2 changed files with 4 additions and 4 deletions
  1. 1 1
      spec/fixtures/api/crash-restart.html
  2. 3 3
      spec/fixtures/api/crash.html

+ 1 - 1
spec/fixtures/api/crash-restart.html

@@ -2,7 +2,7 @@
 <body>
 <script type="text/javascript" charset="utf-8">
 
-const {port} = require('url').parse(window.location.href, true).query
+const port = (new URLSearchParams(location.search)).get('port')
 const {crashReporter, ipcRenderer} = require('electron')
 
 crashReporter.start({

+ 3 - 3
spec/fixtures/api/crash.html

@@ -2,9 +2,9 @@
 
 <body>
   <script type="text/javascript" charset="utf-8">
-    const url = require('url').parse(window.location.href, true);
-    const uploadToServer = !url.query.skipUpload;
-    const port = url.query.port;
+    const query = new URLSearchParams(location.search)
+    const port = query.get('port')
+    const uploadToServer = !query.has('skipUpload')
     const {crashReporter, ipcRenderer} = require('electron');
 
     crashReporter.start({