-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a simple dotjs plugin system #6
Conversation
Ever since the dotjs project got abandoned I've been looking for something similar. It works like dis: Whenever a webpage is loaded we look for a file in `~/.js/<hostname>.js` and if we find one we read it's contents and execute the javascript we find there on the page we just loaded. I think the quote on the original dotjs project describes the functionality pretty well. > "I almost wish you could just stick JavaScript in ~/.js. Do you know what I'm saying?" - https://github.com/defunkt/dotjs
Hey! 👋 I need to organize things a bit in the project first so I can accept PRs. Webpages plugins are on the todo list though so that'll come soon – super happy learning about dotjs :) Since the implementation might be a little different I'd suggest to maybe store the plugins in Application Support/Oryoki? Possibly also adding a menu toggle to turn everything on/off. |
Awesome! I'm in no rush to merge this since I can just use my current fork for now. If you need a hand you could label some issues and I might be able to pick some up when I have some spare time.
I added a preference for plugin folder path in 6635d24 since I really like having my plugins at
I didn't do this yet but I probably will soon. |
Ok I added this in a81bef4 but it's not persistant between reboots (just like |
Just checked out your branch. Trying to wrap my head around it. Node paths are a little tricky I guess, so just using Q: why use |
Hey there – branched off dev to implement the dotjs-like plugin system (5fc5edd). I think your PR came in a little early, but the project is ready-ish now. I'll branch off dev for every feature and merge back up to master for releases. Basically your code, with a few tweaks: A – if the path defined in preferences isn't set we look for plugins in Application Support/Web Plugins. I need to rewrite a bit the preference file so it accepts comments to explain that. B – we reload the page when toggling the web plugins. I also added I'm looking at adding a couple default plugins now. What are some useful ones? Thinking of one that adds a way of playing youtube etc. in full window, so you can have video players floating on top of everything else. ✌️ |
Hey! Web plugins are implemented in /dev as of 5645bc2 💥
Looks okay to me, but let me know if you end up using it and find anything :) I included hot-reloading the preference file so you can change the directory without relaunching the app. The menu toggle also reloads the current view when turning the plugins on/off. Plugins can be activated independently on each window. |
✨✨✨ AWESOME ✨✨✨ Sorry for not being responsive about this PR but real life got in the way 😄 |
Hey hey 👋 I've no idea if you're accepting PRs to this project but I just saw it on HN and really like it.
Ever since the dotjs project got abandoned I've been looking for something similar. It works like dis:
Whenever a webpage is loaded we look for a file in
~/.js/<hostname>.js
and if we find one we read it's contents and execute the javascript we find there on the page we just loaded.I think the quote on the original dotjs project describes the functionality pretty well.