-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 35c4ff3
Showing
9 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
dist | ||
node_modules/* | ||
electron-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
var app = require('app'); // Module to control application life. | ||
var Menu = require('menu'); | ||
var Tray = require('tray'); | ||
var BrowserWindow = require('browser-window'); // Module to create native browser window. | ||
var mainWindow = null; | ||
var appIcon = null; | ||
var win = null; | ||
|
||
var template = [ | ||
{ | ||
label: 'Whatsapp', | ||
submenu: [ | ||
{ | ||
label: 'About Whatsapp', | ||
selector: 'orderFrontStandardAboutPanel:' | ||
}, | ||
{ type: 'separator' }, | ||
{ | ||
label: 'Hide Whatsapp', | ||
accelerator: 'Command+H', | ||
selector: 'hide:' | ||
}, | ||
{ | ||
label: 'Hide Others', | ||
accelerator: 'Command+Shift+H', | ||
selector: 'hideOtherApplications:' | ||
}, | ||
{ | ||
label: 'Show All', | ||
selector: 'unhideAllApplications:' | ||
}, | ||
{ type: 'separator' }, | ||
{ | ||
label: 'Quit', | ||
accelerator: 'Command+Q', | ||
selector: 'terminate:' | ||
}, | ||
] | ||
}, | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{ | ||
label: 'Undo', | ||
accelerator: 'Command+Z', | ||
selector: 'undo:' | ||
}, | ||
{ | ||
label: 'Redo', | ||
accelerator: 'Shift+Command+Z', | ||
selector: 'redo:' | ||
}, | ||
{ type: 'separator' }, | ||
{ | ||
label: 'Cut', | ||
accelerator: 'Command+X', | ||
selector: 'cut:' | ||
}, | ||
{ | ||
label: 'Copy', | ||
accelerator: 'Command+C', | ||
selector: 'copy:' | ||
}, | ||
{ | ||
label: 'Paste', | ||
accelerator: 'Command+V', | ||
selector: 'paste:' | ||
}, | ||
{ | ||
label: 'Select All', | ||
accelerator: 'Command+A', | ||
selector: 'selectAll:' | ||
} | ||
] | ||
}, | ||
{ | ||
label: 'View', | ||
submenu: [ | ||
{ | ||
label: 'Reload', | ||
accelerator: 'Command+R', | ||
click: function() { remote.getCurrentWindow().reload(); } | ||
}, | ||
{ | ||
label: 'Toggle DevTools', | ||
accelerator: 'Alt+Command+I', | ||
click: function() { remote.getCurrentWindow().toggleDevTools(); } | ||
}, | ||
] | ||
}, | ||
{ | ||
label: 'Window', | ||
submenu: [ | ||
{ | ||
label: 'Minimize', | ||
accelerator: 'Command+M', | ||
selector: 'performMiniaturize:' | ||
}, | ||
{ | ||
label: 'Close', | ||
accelerator: 'Command+W', | ||
selector: 'hide:' | ||
}, | ||
{ type: 'separator' }, | ||
{ | ||
label: 'Bring All to Front', | ||
selector: 'arrangeInFront:' | ||
} | ||
] | ||
} | ||
]; | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', function() { | ||
app.quit(); | ||
}); | ||
|
||
// Initialization. | ||
app.on('ready', function() { | ||
// Configuration | ||
appIcon = new Tray(__dirname+'/assets/trayTemplate.png'); | ||
appIcon.on("clicked", function(){ | ||
win.show(); | ||
}); | ||
appIcon.setToolTip('Whatsapp'); | ||
|
||
var menu = Menu.buildFromTemplate(template); | ||
Menu.setApplicationMenu(menu); | ||
|
||
// Create the browser window. | ||
win = new BrowserWindow({ | ||
"width": 900, | ||
"height": 720, | ||
"type": "toolbar", | ||
"title": "Whatsapp", | ||
"node-integration": false, | ||
}); | ||
|
||
// Load the app page | ||
win.loadUrl('https://web.whatsapp.com', { | ||
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.52 Safari/537.36' | ||
}); | ||
|
||
// Open links externally | ||
win.webContents.on("new-window", function(event, url, frameName, disposition){ | ||
require('shell').openExternal(url) | ||
event.preventDefault(); | ||
}); | ||
|
||
// Open the devtools. | ||
// win.openDevTools(); | ||
|
||
// Emitted when the window is closed. | ||
win.on('closed', function() { | ||
win = null; | ||
}); | ||
|
||
// app.dock.hide(); | ||
win.show(); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name" : "whatsapp", | ||
"version" : "0.1.1", | ||
"main" : "app.js" | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "whatsapp-desktop", | ||
"version": "0.1.1", | ||
"description": "Unofficial Whatsapp Desktop Client. Build with Electron.", | ||
"main": "app.js", | ||
"scripts": { | ||
"dev": "electron ./app", | ||
"clean": "rm -rf ./dist", | ||
"clean:osx": "rm -rf ./dist/osx", | ||
"build": "npm run clean && npm run build:osx", | ||
"build:osx": "npm run clean:osx && electron-packager ./app \"Whatsapp\" --out=dist/osx --platform=darwin --arch=x64 --version=0.28.3 --icon=assets/osx/whatsapp.icns", | ||
"pack": "npm run pack:osx", | ||
"pack:osx": "npm run build:osx && electron-builder \"dist/osx/Whatsapp.app\" --platform=osx --out=\"dist/osx\" --config=packager.json" | ||
}, | ||
"devDependencies": { | ||
"electron-packager": "^4.1.3", | ||
"electron-prebuilt": "^0.28.3", | ||
"electron-builder": "^2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"osx" : { | ||
"title": "Whatsapp", | ||
"icon": "assets/osx/whatsapp.icns", | ||
"icon-size": 80, | ||
"contents": [ | ||
{ "x": 438, "y": 344, "type": "link", "path": "/Applications" }, | ||
{ "x": 192, "y": 344, "type": "file" } | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Whatsapp Desktop | ||
|
||
Whatsapp desktop client for OSX, based on the official whatsapp web app. Build with [Electron](http://electron.atom.io/). | ||
|
||
|
||
This is **NOT** an official product. This project does not attempt to reverse engineer the WhatsApp API or attempt to reimplement any part of the WhatsApp client. Any communication between the user and WhatsApp servers is handled by official WhatsApp Web itself; this is just a native wrapper for WhatsApp Web, like a browser. | ||
|
||
## Features | ||
|
||
* Native notifications. | ||
* System tray icon. | ||
* Open links in browser. | ||
|
||
**Planned features:** | ||
|
||
* Badge with the number of notifications in the dock/taskbar. | ||
* Auto-launch on OS startup. | ||
|
||
## Contributions | ||
|
||
Contributions are welcome! For feature requests and bug reports please submit an [issue](https://github.com/bcalik/whatsapp-desktop/issues). | ||
|
||
## Build | ||
|
||
`npm install` | ||
`npm run build` |