Skip to content

Commit

Permalink
fix: blank page
Browse files Browse the repository at this point in the history
  • Loading branch information
dice2o committed May 12, 2023
1 parent d5e6528 commit fca6ac6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
4 changes: 2 additions & 2 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
productName: 'BingGPT',
description: 'AI-powered copilot',
productDescription: 'AI-powered copilot',
version: '0.3.4',
version: '0.3.5',
categories: ['Utility'],
maintainer: 'dice2o',
homepage: 'https://github.com/dice2o/BingGPT',
Expand All @@ -56,7 +56,7 @@ module.exports = {
productName: 'BingGPT',
description: 'AI-powered copilot',
productDescription: 'AI-powered copilot',
version: '0.3.4',
version: '0.3.5',
categories: ['Utility'],
maintainer: 'dice2o',
homepage: 'https://github.com/dice2o/BingGPT',
Expand Down
12 changes: 2 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const createWindow = () => {
},
},
{
label: 'BingGPT v0.3.4',
label: 'BingGPT v0.3.5',
visible: parameters.selectionText.trim().length === 0,
click: () => {
shell.openExternal('https://github.com/dice2o/BingGPT/releases')
Expand All @@ -227,7 +227,7 @@ const createWindow = () => {
isDarkMode ? 'dark' : 'light'
}schemeovr=1&FORM=SHORUN&udscs=1&udsnav=1&setlang=${locale}&features=udssydinternal&clientscopes=windowheader,coauthor,chat,&udsframed=1`
const userAgent =
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.0.0'
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
mainWindow.loadURL(bingUrl)
// Open links in default browser
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
Expand Down Expand Up @@ -268,14 +268,6 @@ const createWindow = () => {
}
}
)
// Modify headers
mainWindow.webContents.session.webRequest.onBeforeSendHeaders(
(details, callback) => {
details.requestHeaders['User-Agent'] = userAgent
details.requestHeaders['X-Forwarded-For'] = '1.1.1.1'
callback({ requestHeaders: details.requestHeaders, cancel: false })
}
)
// Always on top
const alwaysOnTopHandler = () => {
config.set('alwaysOnTop', !mainWindow.isAlwaysOnTop())
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "binggpt",
"productName": "BingGPT",
"version": "0.3.4",
"version": "0.3.5",
"description": "AI-powered copilot",
"author": "dice2o",
"license": "Apache-2.0",
Expand Down
13 changes: 5 additions & 8 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ window.addEventListener('DOMContentLoaded', () => {
}
if (joinLink) {
joinLink.setAttribute('target', '_self')
joinLink.setAttribute(
'href',
'https://www.bing.com/rewards/authcheck?ru=%2Fmsrewards%2Fapi%2Fv1%2Fenroll%3Fpubl%3DBINGIP%26crea%3DMY00IA%26pn%3Dbingcopilotwaitlist%26partnerId%3DBingRewards%26pred%3Dtrue%26wtc%3Dshoreline/discover%26ru%3Dhttps%253a%252f%252fedgeservices.bing.com%252fedgesvc%252furlredirect%253fscenario%253dwaitlist'
)
}
if (previewBanner) {
previewBanner.style.cssText = 'margin-top: 44px'
Expand Down Expand Up @@ -354,15 +358,8 @@ const markdownHandler = (element) => {
},
})
const mdDataURL = Buffer.from(
turndownService.turndown(element) + '\n',
turndownService.turndown(element),
'utf-8'
).toString('base64')
ipcRenderer.send('export-data', 'md', mdDataURL)
}

// Fix copy issue
window.addEventListener('copy', (event) => {
const selection = document.getSelection()
event.clipboardData.setData('text/plain', selection.toString())
event.preventDefault()
})

0 comments on commit fca6ac6

Please sign in to comment.