Fix js coding style errors
This commit is contained in:
parent
9f3cfa2dbd
commit
1e9942c1bf
3 changed files with 50 additions and 60 deletions
|
@ -992,9 +992,6 @@ describe('chromium feature', function () {
|
|||
slashes: true
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
function createBrowserWindow ({plugins, preload}) {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
|
@ -1005,8 +1002,6 @@ describe('chromium feature', function () {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
function testPDFIsLoadedInSubFrame (page, preloadFile, done) {
|
||||
const pagePath = url.format({
|
||||
pathname: path.join(fixtures, 'pages', page).replace(/\\/g, '/'),
|
||||
|
@ -1029,7 +1024,6 @@ describe('chromium feature', function () {
|
|||
w.webContents.loadURL(pagePath)
|
||||
}
|
||||
|
||||
|
||||
it('opens when loading a pdf resource as top level navigation', function (done) {
|
||||
createBrowserWindow({plugins: true, preload: 'preload-pdf-loaded.js'})
|
||||
ipcMain.once('pdf-loaded', function (event, state) {
|
||||
|
@ -1101,8 +1095,6 @@ describe('chromium feature', function () {
|
|||
it('opens when loading a pdf resource in a nested iframe', function (done) {
|
||||
testPDFIsLoadedInSubFrame('pdf-in-nested-iframe.html', 'preload-pdf-loaded-in-nested-subframe.js', done)
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
describe('window.alert(message, title)', function () {
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
const {ipcRenderer} = require('electron')
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
var outerFrame = document.getElementById('outer-frame');
|
||||
document.addEventListener('DOMContentLoaded', function (event) {
|
||||
var outerFrame = document.getElementById('outer-frame')
|
||||
if (outerFrame) {
|
||||
outerFrame.onload = function () {
|
||||
var pdframe = outerFrame.contentWindow.document.getElementById('pdf-frame');
|
||||
var pdframe = outerFrame.contentWindow.document.getElementById('pdf-frame')
|
||||
if (pdframe) {
|
||||
pdframe.contentWindow.addEventListener('pdf-loaded', function (event) {
|
||||
ipcRenderer.send('pdf-loaded', event.detail)
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
const {ipcRenderer} = require('electron')
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
var subframe = document.getElementById('pdf-frame');
|
||||
document.addEventListener('DOMContentLoaded', function (event) {
|
||||
var subframe = document.getElementById('pdf-frame')
|
||||
if (subframe) {
|
||||
subframe.contentWindow.addEventListener('pdf-loaded', function (event) {
|
||||
ipcRenderer.send('pdf-loaded', event.detail)
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue