-
Notifications
You must be signed in to change notification settings - Fork 28
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
Showing
18 changed files
with
700 additions
and
99 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
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 |
---|---|---|
@@ -1,94 +1,112 @@ | ||
MacPin | ||
======= | ||
MacPin creates a hybrid OSX & Web app from a simple Javascript. | ||
It appears as a very stripped down browser with just a tab-bar (aka. "Site Specific Browser"). | ||
You can see it in your App Switcher and it can post to Notification Center and recieve custom-scheme URLs opened on your Mac via Launch Services. | ||
# MacPin | ||
MacPin creates a Mac OSX App shell for websites & webapps from a short JavaScript you provide. | ||
Some call these Apps [Site-specific Browsers](https://en.wikipedia.org/wiki/Site-specific_browser) or Hybrid apps. | ||
|
||
(OSX 10.10 "Yosemite" required) | ||
The Browser UI is very minimal, just a tab-bar which disappears in Full-Screen mode, leaving only the site content. | ||
|
||
Included Apps | ||
====== | ||
MacPin apps sit in your Dock, App Switcher, and Launchpad. | ||
Userscripts can be injected to facilitate posting to the Notification Center & recalling webapp locations/state from those posts. | ||
|
||
* [Hangouts.app](http://plus.google.com/hangouts) | ||
=== | ||
Chrome-less Hangouts client for your desktop. | ||
![screenie](/sites/Hangouts/screenshot.jpg?raw=true) | ||
Load up does take about 30 secs, so be patient. | ||
New incoming messages are shown in OSX's Notification Center, clicking them will popup the contact in the app so you can reply quickly. | ||
Custom URL schemes can also be registered to launch your App from any other app on your Mac. | ||
|
||
``` | ||
# URLs: | ||
sms:5558675309 | ||
tel:18001234567 | ||
hangouts:[email protected] | ||
``` | ||
Included is an OSX Service that allows highlighting a phone number in any text and right clicking to open a Hangout Call for it. | ||
Several browser extensions can also make phone numbers found in webpages clickable. | ||
OSX 10.10 "Yosemite" is required. | ||
4 apps are prebuilt for download in the GitHub release. | ||
|
||
If you have a Google Voice number linked to your Hangouts account, incoming calls will popup in the roster. | ||
* press Enter or Space to Accept the call | ||
* press ESC or Backspace to Decline it | ||
## Included Apps | ||
|
||
* [Digg.app](http://digg.com/reader) | ||
=== | ||
My chosen replacement for Google Reader. | ||
``` | ||
# URLs: | ||
feed:http://example.com/sampleblog.xml | ||
rss://example.com/sampleblog.xml | ||
``` | ||
#### [Hangouts.app](http://plus.google.com/hangouts): SMS/IM/Video chat client for the desktop | ||
![screenie](/sites/Hangouts/screenshot.jpg?raw=true) | ||
Load up does take up to 30 seconds, so be patient. | ||
|
||
If you are surfing a blog in Safari and want to subscribe to it in your Digg Reader account: | ||
* click Safari's Sharing button | ||
* click "Add to Shared Links" | ||
* Answer "No" when prompted to add it your Safari Shared links. | ||
* If Safari found a feed or rss metatag/mime-type, it will be passed to the Digg app which will prompt you to add it to your subscriptions. | ||
* PROTIP: [Add the old RSS button back to Safari 8](http://www.red-sweater.com/blog/2624/subscribe-to-feed-safari-extension) | ||
|
||
* [Trello.app](http://trello.com) | ||
=== | ||
Mind-mapper and project planner extraordinaire. Pinterest for geeks :-) | ||
![screenie](/sites/Trello/screenshot.jpg?raw=true) | ||
``` | ||
URLs: | ||
trello:<search keywords> | ||
``` | ||
New incoming messages are shown in OSX's Notification Center, | ||
which you can click on to reply back in the app. | ||
|
||
Under [extras/](/sites/Hangouts/extras) you'll find: | ||
|
||
* `Call via Hangouts.service`: enables selecting and right-clicking a phone number in any App's text to make a Hangout Call | ||
* `HangoutsAddressBookPlugin`: allows click-to-call from Contacts.app phone number fields | ||
|
||
Several browser extensions can also make phone numbers found in webpages clickable. | ||
|
||
If you have a Google Voice number linked to your Hangouts account, incoming calls will popup in the App's contacts roster. | ||
Hangouts.app will automatically steal focus so you can quickly answer or reject the call using the keyboard: | ||
|
||
* press Enter or Space to accept the call | ||
* press Escape or Backspace to decline it | ||
|
||
Custom URLs: [SMS](sms:5558675309) [Call](tel:18001234567) [IM](hangouts:[email protected]) | ||
|
||
|
||
#### [Digg.app](http://digg.com/reader): A replacement for Google Reader | ||
|
||
If you are surfing a blog in Safari and want to subscribe to it in your Digg Reader account: | ||
|
||
* click Safari's Sharing button | ||
* click "Add to Shared Links" | ||
* Answer "No" when prompted to add it your Safari Shared links. | ||
* If Safari found a feed or rss metatag/mime-type, it will be passed to Digg.app which will prompt you to add it to your subscriptions. | ||
* PROTIP: [Add the old RSS button back to Safari 8](http://www.red-sweater.com/blog/2624/subscribe-to-feed-safari-extension) | ||
|
||
Custom URLs: [feed](feed:http://example.com/sampleblog.xml) [rss](rss://example.com/sampleblog.xml) | ||
|
||
Opening these urls will pop a tab with a search of your Trello boards and cards for the supplied keywords. | ||
PROTIP: Install Alfred, Quicksilver, or Spotlight to facilitate really fast searches. | ||
#### [Trello.app](http://trello.com): Mind-mapper and project planner | ||
![screenie](/sites/Trello/screenshot.jpg?raw=true) | ||
|
||
* [Vine.app](http://vine.co) | ||
=== | ||
It shows the mobile version of the site and does not preload any videos, | ||
so you can choose how to spend your bandwidth & time. | ||
#### [Vine.app](http://vine.co): Mobile-layout edition for the desktop | ||
|
||
Vine has a webpage now, but it is a grid layout and PRECACHES 100% of ALL OF THE VIDEOS on Safari. | ||
Vine.app shows the mobile layout and does not preload any videos. | ||
|
||
Custom URLs: [search your trello for something](trello:search for something) | ||
|
||
|
||
## Creating an App | ||
|
||
Creating an App | ||
==== | ||
``` | ||
mkdir sites/MySite | ||
vim sites/MySite/app.js | ||
# look at other sites/*/app.js and WebAppScriptExports for available commands | ||
# peruse sites/*/app.js for available commands | ||
make | ||
open apps/MySite.app | ||
# test, tweak, repeat | ||
# test, tweak, lather, repeat | ||
# find a suitable .png or .icns for the app | ||
cp ~/Pictures/MySite.png icons/ | ||
# else WebKit.icns will be used | ||
make install | ||
open -a MySite.app | ||
#to customize the icon, find a suitable .png or .icns and place it in icons/ and remake | ||
cp ~/Pictures/MySite.png icons/ | ||
``` | ||
|
||
Develop | ||
=== | ||
It's mostly written in Swift using WKWebView and NSTabViewController. | ||
No NIBs, fully programmatic UI layout. | ||
You need Xcode installed on OSX Yosemite to get the Swift compiler and Cocoa headers. | ||
## Hacking the Gibs^H^H^H^HMacPin | ||
|
||
It's written in Swift using WKWebView and NSTabViewController. | ||
Fully programmatic NIB-less UI layout. Easy for a single window without any dialogs :-) | ||
You need Xcode installed on OSX Yosemite to get the Swift compiler and Cocoa headers. | ||
|
||
``` | ||
vim webview.swift | ||
vim execs/MacPin.swift | ||
vim modules/MacPin/*.swift | ||
make test | ||
``` | ||
Web Inspector is available in the app, and remote debugging via Safari too when debug= is set in the Makefile. | ||
|
||
Check out https://github.com/mozilla/firefox-ios/ to see a another Swift-based browser for iOS. | ||
Web Inspector is available in the app, and remote debugging via Safari too when `debug=` is set in the Makefile. | ||
|
||
The JavaScript API is undocumented and unstable, but I think its mostly fleshed out now. | ||
|
||
Some browser functionality is unimplementable, partly due to WKWebKit's immaturity: | ||
|
||
* File Uploads via File Picker (HTML5 drag & drop is working) | ||
* Geolocation | ||
* Printing | ||
* Favicons | ||
|
||
And some things I just haven't had need to write: | ||
|
||
* Bookmarks, global history | ||
* Undo/redo tabs | ||
|
||
|
||
Check out [Firefox for iOS](https://github.com/mozilla/firefox-ios/) to see another Swift-based browser for iOS. |
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
Oops, something went wrong.