Skip to content

Commit

Permalink
removed navigation and back button, resized window (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plastikmensch committed Jul 26, 2020
1 parent 587f428 commit e8292a4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function createWindow () {
else {
//open new window
if (twitterWin === undefined) {
twitterWin = new BrowserWindow({ parent: mainWindow, webPreferences: { enableRemoteModule: false, contextIsolation: true}})
twitterWin = new BrowserWindow({ parent: mainWindow, width: 600, height: 700, resizable: false, webPreferences: { enableRemoteModule: false, contextIsolation: true}})
common.log('created twitterWin', 0)
twitterWin.removeMenu()

Expand All @@ -147,13 +147,15 @@ function createWindow () {
twitterWin.loadURL(nav.fail)
common.log('failed to load', 0)
})
//prevent window from opening other windows
twitterWin.webContents.on('new-window', (event) => {
event.preventDefault()
})
twitterWin.webContents.on('will-navigate', (event) => {
event.preventDefault()

twitterWin.webContents.on('did-finish-load', () => {
//make navigation and back button invisible
const css =
`[role="banner"] {display: none !important}
.r-u0dd49 {display: none !important}`
twitterWin.webContents.insertCSS(css.trim())
})

twitterWin.on('closed', () => {
twitterWin = undefined
common.log('closed twitterWin', 0)
Expand Down

0 comments on commit e8292a4

Please sign in to comment.