Browse Source

fix the crash when loading site with jquery (#13476)

Cheng Zhao 6 years ago
parent
commit
0a3211c387
3 changed files with 22 additions and 1 deletions
  1. 14 0
      spec/chromium-spec.js
  2. 7 0
      spec/fixtures/pages/jquery.html
  3. 1 1
      vendor/libchromiumcontent

+ 14 - 0
spec/chromium-spec.js

@@ -79,6 +79,20 @@ describe('chromium feature', () => {
     })
   })
 
+  describe('loading jquery', () => {
+    it('does not crash', (done) => {
+      w = new BrowserWindow({
+        show: false,
+        webPreferences: {
+          nodeIntegration: false
+        }
+      })
+      w.webContents.once('did-finish-load', () => { done() })
+      w.webContents.once('crashed', () => done(new Error('WebContents crashed.')))
+      w.loadURL(`file://${fixtures}/pages/jquery.html`)
+    })
+  })
+
   describe('navigator.webkitGetUserMedia', () => {
     it('calls its callbacks', (done) => {
       navigator.webkitGetUserMedia({

+ 7 - 0
spec/fixtures/pages/jquery.html

@@ -0,0 +1,7 @@
+<html>
+<head>
+  <script src="../../static/jquery-2.0.3.min.js"></script>
+</head>
+<body>
+</body>
+</html>

+ 1 - 1
vendor/libchromiumcontent

@@ -1 +1 @@
-Subproject commit 2006b899d1927dd260ea0f170bdf01c2d5eda6a1
+Subproject commit a604af6f51a2e816592db475159ee898f212d9db