Skip to content

Commit

Permalink
fixed blank screen bug, added more logging, updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Plastikmensch committed Oct 24, 2017
1 parent e2783f6 commit 81819da
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ customProxy =foopy:80
Or use the in-app settings! Press `Alt` -> `App` -> `Settings`
## Packaging source
you can use [electron-packager](https://github.com/electron-userland/electron-packager)
```sh
# make sure to always include --asar-unpackDir or else Tor won't run
electron-packager <src> <options> --asar.unpackDir="tor-win32-0.3.0.9"
```
9 changes: 7 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function createWindow (Settings) {
console.log("Not using Tor or custom Proxy")
}
mainWindow.webContents.on('did-fail-load', () => {
console.log("failed to load. Retrying...")
mainWindow.loadURL(home)
if(retries==3) mainWindow.loadURL(url2)
retries++
Expand All @@ -60,8 +61,9 @@ function createWindow (Settings) {
if(!Settings[1][0])
{
mainWindow.webContents.insertCSS(".avatar{border-radius:0 !important}")// makes profile pics angular shaped again Woohoo!
console.log("inserted code for angular profile pics")
}
if(Settings[2][0])
if(Settings[2][0] && mainWindow.webContents.getURL().search("https://tweetdeck.twitter.com/") == 0)
{
mainWindow.webContents.insertCSS("\
.cmp-replyto{background-color: #222426 !important}\
Expand Down Expand Up @@ -94,13 +96,15 @@ function createWindow (Settings) {
.list-link:hover{background-color: #0e0e0e !important}\
.mdl,.mdl-inner,.mdl-column,.mdl-col-settings,.bg-seamful-faint-gray,.bg-seamful-faded-gray{background-color: #222426 !important}\
.frm,.a-list-link,.list-link,.mdl-header,.mdl-dismiss,.non-selectable-item{color: #fff !important}")
console.log("inserted code for dark theme")
}
})
mainWindow.webContents.on('new-window', (event,url) => {
if(url.search('https://tweetdeck.twitter.com/') !== 0 || url.search('https://twitter.com/') !== 0)
{
event.preventDefault()
shell.openExternal(url)
console.log("opened link external")
}
})
mainWindow.webContents.on('will-navigate', (event, url) => {
Expand Down Expand Up @@ -179,11 +183,12 @@ function startTor() {
if(process.platform == 'win32')
{
var child = require('child_process').execFile(tor)
console.log("started Tor")
}
}

app.on('ready', () => {

app.commandLine.appendSwitch('disable-gpu-compositing')//fixes blank screen bug... fucking hell...
if(!fs.existsSync(settingsFile))
{
dialog.showMessageBox({type:'question', buttons:['No','Yes'],message:'Do you want to use Tor?'}, (response)=>{
Expand Down
25 changes: 13 additions & 12 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"productName" : "Tweelectron",
"version" : "1.0.6",
"main" : "main.js",
"description": "TweetDeck for Desktop",
"author": {
"name": "Plastikmensch"
},
"devDependencies": {
"electron": "^1.7.0"
}
}
{
"productName": "Tweelectron",
"version": "1.0.6",
"main": "main.js",
"description": "TweetDeck for Desktop",
"author": {
"name": "Plastikmensch"
},
"devDependencies": {
"electron": "^1.7.9"
},
"dependencies": {}
}
Binary file added tweetdeck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 81819da

Please sign in to comment.