xcloud-keyboard-mouse
xcloud-keyboard-mouse copied to clipboard
Safari Support (macOS)
Hello fellow Apple users!
I'm super close to having full support for Safari (the extension works 100% when I test locally in Safari as of commit https://github.com/idolize/xcloud-keyboard-mouse/commit/42fde71bac7498d159b922421f57dd3ac23e7c30). Here are the instructions for how to build/run it yourself locally if you want.
The only thing blocking a fully-supported Safari release right now is distribution.
Apple forces Safari extensions to be distributed as native apps. I already have a working native app, but I just don't have a good way to build and distribute it.
The main (recommended) method for Safari extension distribution is the App Store. However, this method costs money - Apple charges $100/year for access to their developer program. (By contrast, Chrome charges a one-time fee of $5 for lifetime access to the Chrome Web Store.) I've made ~$0~ (edit: $10 😄 ) on this extension so far, so I'm not too excited to incur a $100/year expense on something I'm doing for free.
The only other possible method for distribution (at least on macOS Safari) is notarization and self-hosting of the extension. Basically, I can make a build, get it signed by Apple, and host it on the webpage here for download for free. This works - but it will be annoying to distribute updates using this method. Without going too deep on the subject: the way most self-distributed mac apps handle updates is with something like Sparkle, which can prompt users to update to the latest version when they open the app. However, since the "apps" that you distribute for Safari extensions do not require the user to open it at all, other than once at the very beginning, it is very unlikely Safari users will ever re-open the app (even if they use the extension regularly) and thus will almost never see this update prompt if I use Sparkle.
So, I'm at a bit of a stand-still right now for Safari. I may end up doing with the second approach and using Sparkle for updates, but adding some reminder text to tell users to check periodically for updates.
Or, if I manage to get at least $100 in donations, then I may consider the Mac App Store approach as well.
Lastly- it should also technically be possible to support this extension on iOS 15 now as well! Not sure if that's something people actually want/would use, but maybe for iPad users? If so, this would absolutely require the Apple developer account since iOS devices are completely limited to App Store as a distribution method.
For anyone coming here that is interested/daring enough to build and run the extension for Safari themselves, here are the steps needed: https://github.com/idolize/xcloud-keyboard-mouse/tree/master/safari#readme
Wrong place to ask this, I know; but I am trying to build this for my Mac, and getting the following errors when running npm run build:safari
- wonder if it's some dependency that I am missing?
npm run build:safari ✹
> xcloud-keyboard-mouse@ build:safari /Users/nachofernandez/Personal/git/xcloud-keyboard-mouse
> webpack --env browser=safari --config webpack/webpack.prod.js
[webpack-cli] HookWebpackError: Not supported
at makeWebpackError (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/HookWebpackError.js:48:9)
at hooks.processAssets.callAsync.err (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:3055:12)
at eval (eval at create (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:50:1)
at err (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:508:26)
at compilation.hooks.processAssets.tapAsync (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/copy-webpack-plugin/dist/index.js:705:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- inner error --
Error: Not supported
at compilation.hooks.processAssets.tapAsync (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/copy-webpack-plugin/dist/index.js:701:13)
at fn (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:507:9)
at Hook.eval [as callAsync] (eval at create (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/tapable/lib/Hook.js:18:14)
at cont (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:3052:34)
at createChunkAssets.err (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:3100:10)
at symbolIterator (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:3485:9)
at done (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:3527:9)
at /Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:2830:7
at done (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:2865:11)
caused by plugins in Compilation.hooks.processAssets
Error: Not supported
at compilation.hooks.processAssets.tapAsync (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/copy-webpack-plugin/dist/index.js:701:13)
at fn (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:507:9)
at Hook.eval [as callAsync] (eval at create (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:48:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/tapable/lib/Hook.js:18:14)
at cont (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:3052:34)
at createChunkAssets.err (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/webpack/lib/Compilation.js:3100:10)
at symbolIterator (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:3485:9)
at done (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:3527:9)
at /Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:2830:7
at done (/Users/nachofernandez/Personal/git/xcloud-keyboard-mouse/node_modules/neo-async/async.js:2865:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! xcloud-keyboard-mouse@ build:safari: `webpack --env browser=safari --config webpack/webpack.prod.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the xcloud-keyboard-mouse@ build:safari script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Hi @Napo2k did you do npm install
first?
Hello! Yes, I did :)
@Napo2k at first I ran install
with the outdated npm version I already had on my system, got a warning about package-lock incompatibility, and the same error message you had during the build.
Updating node/npm to the newest versions, and running install/build again solved the issue for me.
@idolize I have a Dev Account that I pay for every year and can host the app if you want?