{"id":13572640,"url":"https://github.com/kfix/MacPin","last_synced_at":"2025-04-04T10:31:04.378Z","repository":{"id":26320652,"uuid":"29768943","full_name":"kfix/MacPin","owner":"kfix","description":"a webapp container \u0026 site specific browser made from WebKit.swift and JavaScriptCore","archived":false,"fork":false,"pushed_at":"2022-11-29T15:55:20.000Z","size":9641,"stargazers_count":339,"open_issues_count":9,"forks_count":28,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-30T18:08:55.604Z","etag":null,"topics":["javascriptcore","osx","site-specific-browser","ssb","swift","webkit","wkwebview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bootstrap-vue/bootstrap-vue","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-24T07:17:11.000Z","updated_at":"2025-03-05T22:43:50.000Z","dependencies_parsed_at":"2022-07-08T01:10:35.259Z","dependency_job_id":null,"html_url":"https://github.com/kfix/MacPin","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfix%2FMacPin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfix%2FMacPin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfix%2FMacPin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfix%2FMacPin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfix","download_url":"https://codeload.github.com/kfix/MacPin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247160334,"owners_count":20893811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascriptcore","osx","site-specific-browser","ssb","swift","webkit","wkwebview"],"created_at":"2024-08-01T14:01:29.496Z","updated_at":"2025-04-04T10:31:01.870Z","avatar_url":"https://github.com/kfix.png","language":"Swift","readme":"# MacPin\n\u003ccenter\u003e\nMacPin creates pseudo-browsers managed with internal JavaScripts.  \n\n![screenie](/dock_screenshot.png?raw=true \"screen shot\")  \n\u003c/center\u003e\n\nWhile less featureful than Electron-based apps (no Node and Chromium here),   \nthey are slimmer due to nearly-exclusive use of OS-shipped components.  \n\n```\n$ du -hs build/macosx-x86_64-apple-macosx10.13/apps/{Slack,MacPin}.app/\n2.0M\tbuild/macosx-x86_64-apple-macosx10.13/apps/Slack.app/  (mostly Assets.car icons)\n4.0M\tbuild/macosx-x86_64-apple-macosx10.13/apps/MacPin.app/ (icons + 1.5MB MacPin.framework)\n```\n\n## Project Status\nUses swift 5.4 \u0026 WKWebView.\n`sites/**/main.js` tries to support some Electron idioms.  \n* federation of the applet packaging using ES6 modules [is being explored](https://github.com/kfix/MacPin/issues/31)\n\nApps present within a semi-featured Browser UI, having just an [\"OmniBox\"](https://www.chromium.org/user-experience/omnibox) and tab buttons.  \n\nMacPin-built apps are normal .app bundles that show in the Dock, App Switcher, \u0026 Launchpad.  \n\nThey are dependent on the core MacPin.app (4.5MB) to be registered on the system, since it contains the MacPin.framework.  \n\nCustom URL schemes can also be registered to launch a MacPin App from any other app on your Mac.  \n\n## Included Apps in the [Release](https://github.com/kfix/MacPin/releases)\n\n### Gooblers\n* [Google Drive.app](https://drive.google.com)\n* [Google Photos.app](https://photos.google.com)\n* [Google Chat.app](https://chat.google.com)\n* [Google Voice.app](https://voice.google.com)\n* [Google Maps.app](https://www.google.com/maps)\n\n### MetaVerses\n* [Facebook.app](https://m.facebook.com/home.php) (mobile version!)\n* [Messenger.app](https://www.messenger.com/hangouts)\n* [WhatsApp.app](https://web.whatsapp.com)\n\n### et cetera\n* [Twitter.app](https://mobile.twitter.com) (mobile version!)\n* [Slack.app](https://slack.com)\n* [Trello.app](http://trello.com)\n* [DevDocs.app](https://devdocs.io)\n* [Stack Overflow.app](https://stackoverflow.com) (mobile version!)\n\n## Creating an App\nSome call these Apps [Site-specific Browsers](https://en.wikipedia.org/wiki/Site-specific_browser).  \n\n\"Psuedo-browser\" has a better ring to it and MacPin tries to support \"normal\" browsing behavior,   \n(address/status bars, middle-click, pop-ups) complementary to any scripts managing the app.  \n\n```\ncd ~/src/MacPin\nmkdir sites/MySite\n$EDITOR sites/MySite/main.js\n\n# find a large \u0026 square .png for the app, like an App Store image.\n# ideally it should have a transparent back field\ncp ~/Pictures/MySite.png sites/MySite/icon.png\n\nmake test_MySite\n# test, tweak, repeat\n\nmake install\nopen -a MySite.app\n```\n\nWork is ongoing to make editing and creating app scripts easier, without requiring Xcode:CLI tools.\n\n## App porting issues\n\n* DRM: Many sites (Spotify, Netflix) are using Chrome/FF only DRMs (Widevine) but Apple-built WebKit only supports FairPlay DRM.\n* WebRTC: WebKit is compatible with [H264 \u0026 VP8 codecs](https://webkit.org/blog/8672/on-the-road-to-webrtc-1-0-including-vp8/), but Google Chrome is pushing hardware-unaccelerated VP9 on all fronts (incl. general `\u003cvideo\u003e`).\n\n### sample main.js\n```\n/*eslint-env es6*/\n/*eslint eqeqeq:0, quotes:0, space-infix-ops:0, curly:0*/\n\"use strict\";\n\nconst {app, WebView, BrowserWindow} = require(\"@MacPin\");\n\nconst browser = new BrowserWindow();\n\napp.on('AppFinishedLaunching', function() {\n\tbrowser.tabSelected = new WebView({\n\t\turl: \"http://vine.co\",\n\t\ttransparent: true\n\t});\n});\n```\n\n## Hacking MacPin\nBuilding `main` branch requires macOS 11 \"Big Sur\" with Xcode 12.5+.\n\nAll other branches are obsolete \u0026 archived for users locked on older macOS (hardware),  \nbut they will recieve no updates.  \n\nThe UI is fully-programmatic (no NIBs or storyboard) using NSTabViewController APIs to containing tab's WKWebViews.   \nThe AppScriptRuntime that evalutuates `main.js` scripts is cobbled together from JavaScriptCore's C and ObjC APIs.  \n\nMacPin's UI ClassTypes are bridged to ObjC by SwiftCore and once more into Javascript space using the JSWrapperMap facility in the Apple JSC.  \n\nSwift Package Manager and GNU Make are the actual builders of the project, Xcode and `xxcodebuild` are not used or supported.  \n\n### basic workflow\n```\nvim Sources/MacPin/*.swift\nvim sites/MacPin/main.js\nmake test.app\n# CTRL-D when finished debugging ...\n```\n\n### JavaScript environment\nThe JavaScript API for `*.app/main.js` vaguely mimics Electron's `main.js`.  \nIf you want to play with it, run any MacPin app with the `-i` argument in Terminal to get a JS console (or `make repl`).  \n\n~~Debug builds (`make test|test.app|apirepl`) can also be remotely inspected from Safari-\u003eDevelop-\u003e\u003cComputerName\u003e~~\n* Remote Inspection appears broken ATM\n\n### TODOs\nSome things I just haven't had need to write, but wouldn't mind having:\n\n* Global history\n* Undo/redo for Tab closings\n* UI wizard to generate MacPin apps from MacPin.app itself (no Command Line Tools or Xcode!)\n  * maybe using JavaScript-for-Automation (JXA)?\n* ReactNative, Vue/Weex, or NativeScript bindings in main.js for custom Browser UIs\n\n## Other WebKit browsers:\n\n* [Electrino](https://github.com/pojala/Electrino): inspiration for the revamp of MacPin's `main.js`\n* [Firefox for iOS](https://github.com/mozilla/firefox-ios/): another Swift-based browser for iOS.\n* [Chrome for iOS](https://chromium.googlesource.com/chromium/src/+/master/docs/ios/build_instructions.md)[*](https://chromium.googlesource.com/chromium/src.git/+/master/ios/chrome/app/main_application_delegate.mm)\n* [yue](https://github.com/yue/yue-sample-apps/tree/master/browser) on [Mac](https://github.com/yue/yue/blob/master/nativeui/mac/browser_mac.mm) \u0026 [Linux](https://github.com/yue/yue/blob/master/nativeui/gtk/browser_gtk.cc)\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfix%2FMacPin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfix%2FMacPin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfix%2FMacPin/lists"}