Commit Graph

60 Commits

Author SHA1 Message Date
WerWolv
73559ae8c7 Make sure install scripts don't create folders as root v1.2.1 2022-04-22 21:48:36 +02:00
WerWolv
340ea91d1c Fixed calling backend functions after restarting steam 2022-04-22 18:43:52 +02:00
WerWolv
3f3f6bd475 Allow inject_css_into_tab to create more than just a single css rule 2022-04-22 14:30:58 +02:00
WerWolv
4b2f8cd8f5 Make sure old user plugin loader is being removed 2022-04-21 18:03:05 +02:00
WerWolv
604006a7cb Fixed root check 2022-04-21 17:46:53 +02:00
WerWolv
7aa4e9106a Make release script actually work again 2022-04-21 17:44:12 +02:00
marios
fa776f0d0b Callsigns (#37)
* Plugin callsigns, filechangehandler thread bug fix, plugin file perms

- Plugins are now assigned a callsign (a random string), which they use for all internal identification, like resource fetching and method calls. This is to ensure that plugins only access their own resources and methods.
- Made FileChangeHandler send off events to a queue, that is then consumed by the Loader, instead of calling import_plugin on its own, since that caused weird issues with the event loop and the thread watchdog is using.
- Plugins are now owned by root and have read-only permissions. This is handled automatically.

* Improved general look and feel of plugin tab

* Make all plugin entries have the same padding between them

* Make "No plugins installed" text look the same as "No new notifications"

Co-authored-by: WerWolv <werwolv98@gmail.com>
v1.2.0
2022-04-18 15:57:51 +03:00
WerWolv
4576fed01b Properly delete old user plugin loader service on install 2022-04-13 23:18:58 +02:00
tza
de435e22fb added default value to injector tab run_async 2022-04-14 00:01:35 +03:00
tza
6694d5ab71 fixed passive plugin reload bug and close event loop properly 2022-04-13 23:50:26 +03:00
WerWolv
c084abecfc Fixed install script root access 2022-04-13 22:19:48 +02:00
tza
f685eeb420 Added support for passive plugins (that don't implement main.py) 2022-04-13 22:47:22 +03:00
marios
6250fafa6e Fix release script 2022-04-13 21:50:18 +03:00
WerWolv
efa5dc61c7 Update install scripts to install loader as system service 2022-04-13 12:55:33 +02:00
marios
e3d7b50bd9 Root plugins (#35)
* root plugins

plugins can now specify if they want their methods to be ran as root. this is done via the multiprocess module. method calls are delegated to a separate process that is then down-privileged by default to user 1000, so the loader can safely be ran as root

except it isn't really safe because the plugin is imported as root anyway

* working implementation

- follows the new plugin format with the plugin.json file
- plugins are loaded in their own isolated process along with their own event loop and unix socket server for calling methods
- private methods are now prepended with _ instead of __

* converted format to f-strings
2022-04-13 02:14:44 +03:00
WerWolv
0359fd966a Use f-strings instead of .format 2022-04-12 22:27:46 +02:00
WerWolv
fe9faefd0b Added functions to inject and remove css from tabs 2022-04-12 21:59:09 +02:00
WerWolv
012274b1a0 Added library function to execute code in a different tab 2022-04-12 21:15:36 +02:00
Spyrex
070d11154f Bundle stylesheets (#34) 2022-04-11 11:48:41 +02:00
Spyrex
02f73b795d Add vscode debugging (#33) 2022-04-11 12:45:00 +03:00
tza
4ffe2fdf24 added sha-256 hash checking to browser 2022-04-09 00:14:15 +03:00
tza
2045bedee3 plugin title bug fix v1.1.0 2022-04-08 13:47:06 +03:00
tza
e35dd5a028 plugin menu title change bug
Fixed a bug where steam would sometimes fire message events on its own, causing them to be displayed as plugin titles.
2022-04-07 23:22:23 +03:00
tza
c65427e693 initial browser/installer commit, injector get_tab and stateful utils
- Integrated plugin downloader/installer. It accepts POST requests at /browser/install_plugin, containing an artifact (basically an author/repo string like you'd find on github), and a release version, then fetches the zip file from the repo releases and unzips it inside the plugin dir, after asking for user confirmation (pop-up message in the plugin menu).
- Injector get_tab method. Basically get_tabs with the usual search for a specific tab. Decided to implement this because it was needed again and again, and we kept pasting the same list search one-liner.
- Utilities now have access to the main PluginManager class
2022-04-07 22:38:26 +03:00
ttay24
0f14f2707b Added support for including styles/scripts in the header of html files (#29)
* Added support for including styles/scripts in the header of html files

* updated route name
2022-04-07 20:25:03 +03:00
WerWolv
2188aa0343 Moved install commands to new line to make them more readable 2022-04-07 10:20:25 +02:00
WerWolv
3dec82672a Reinject loader if steam got restarted 2022-04-07 09:58:26 +02:00
WerWolv
a3619d1d3a Fixed first plugin button being smaller than the other ones 2022-04-07 09:08:28 +02:00
WerWolv
3a39c88144 Prevent errors from being printed on first install 2022-04-07 01:17:22 +02:00
TrainDoctor
8c0bb20d05 Update readme to show install instructions (#28)
this is for developers/testers
2022-04-07 00:18:42 +02:00
WerWolv
90bd7df52c Tell curl to follow redirection in install command 2022-04-06 20:10:05 +02:00
WerWolv
6644827094 Directly reference install script in install command
Closes #25
2022-04-06 20:07:58 +02:00
tza
fe53bcf127 Change title when inside plugin view 2022-04-06 13:57:21 +03:00
tza
a6943dd7a2 enabled logging, fixed loader refresh bug, removed template 2022-04-06 12:53:19 +03:00
ttay24
85e5554c05 Feature/20 plugins as folders (#24)
* updated loader to watch directories correctly and pull in main.py; also made sure we pull in main.py; WIP on pulling in the template correctly

* Making other changes to support pulling in templates from other pages
2022-04-06 12:40:11 +03:00
Spyrex
8e315fd24d Disable scrolling for tile_view_iframe (#19) 2022-04-06 01:42:15 +03:00
Spyrex
3d0c3ef86f Set tile_view_iframe overflow hidden (#18) 2022-04-06 00:29:17 +03:00
tza
30325397d0 added plugin tile view isolation
Tile views will now run each in their own iframe. This makes it more safe as plugins no longer share the same javascript context, and plugin method calls can now be supported from the tile view.
2022-04-05 22:40:24 +03:00
tza
8d0fe5c45a hot reload now refreshes iframe
also fixed fetch_nocors
2022-04-04 20:46:35 +03:00
WerWolv
1d4100fabb Updated installation guide 2022-04-04 19:17:20 +02:00
WerWolv
0c58ca50fa Added release and nightly download scripts 2022-04-04 19:12:57 +02:00
marios
4d2ab9d19c Added discord link v1.0.0 2022-04-04 19:13:07 +03:00
tza
50382ad3d2 Merge branch 'main' of https://github.com/SteamDeckHomebrew/PluginLoader 2022-04-04 18:10:06 +03:00
tza
8c142c01bd hot reloading, plugin instantiation, plugin main method
- The Loader now watches for file changes in the plugin directory, and will (re)import when a new plugin is created, or an existing one is modified. This is implemented by means of the watchdog library
- Plugin classes are now instantiated (and therefore require a self arg in every method). This way they can maintain a state during the runtime of the loader (or until they are reloaded), and share data between methods.
- Plugins can now have a __main() method, which can include long-running code. Every plugin's main method is ran in a separate asyncio task.
- Plugin methods that start from __ are now uncallable from javascript. This can be helpful when implementing unfinished/development versions of methods.
2022-04-04 18:10:02 +03:00
Liam Dawe
a52399cc00 note it needing touchscreen input (#13)
As mentioned in issues, feels like an area that might need other things adding to it as issues are found :)
2022-04-04 14:33:14 +03:00
Liam Dawe
1bc353fded Missing equals sign for WorkingDirectory (#9) 2022-04-04 12:01:32 +02:00
WerWolv
cbf46b950a Added packager GitHub Actions workflow 2022-04-04 11:39:30 +02:00
tza
449933ec2f fixed tile view not displaying and added library js to iframe root 2022-04-04 03:46:22 +03:00
WerWolv
f1e47767c8 No longer wip, no longer plugin manager 2022-04-03 23:18:18 +02:00
marios
5e9c12bac8 Python rewrite (#6)
* Initial commit. Untested

* various fixes

Core functionality confirmed working:
 - Iframe injection into steam client
 - Plugin fetching from the iframe
 - Plugin opening

* Added function to fetch resources from steam

* Improved injector module, added server-js communication

- Injector module now has methods for better lower-level manipulation of the tab debug websocket.
- Our "front-end" can now communicate with the manager (2-way), completely bypassing the chromium sandbox. This works via a dirty debug console trick, whoever wants to know how it works can take a look at the code.
- Added utility methods file, along with an implementation of the aiohttp client that our "front-end" can access, via the system described above.
- Added js implementations of the communication system described above, which can be imported by plugins.

* Added steam_resource endpoint

* Added basic installer script

* retry logic bug fix

* fixed library injection, event propagation, websocket handling

- library is injected directly into the plugins as well as the plugin list
- resolveMethodCall is implemented in the plugin_list.js file, which in turns calls window.sendMessage on the iframe to propagate the event
- websocket method calls are processed in their own tasks now, so as not to block on long-running calls.

Co-authored-by: tza <tza@hidden>
Co-authored-by: WerWolv <werwolv98@gmail.com>
2022-04-03 23:50:26 +03:00