Skip to content

Commit

Permalink
feat: Add better webkit support for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Nov 27, 2024
1 parent b299c8c commit 33b6cde
Show file tree
Hide file tree
Showing 13 changed files with 1,896 additions and 1,197 deletions.
4 changes: 2 additions & 2 deletions assets/core/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def start_webkit_hook(self, theme, name):

for key in keys:
if key in theme["data"] and isinstance(theme["data"][key], str):
add_browser_css(os.path.join(Millennium.steam_path(), "skins", name, theme["data"][key]))
add_browser_css(os.path.join(Millennium.steam_path(), "steamui", "skins", name, theme["data"][key]))

if "webkitJS" in theme["data"] and isinstance(theme["data"]["webkitJS"], str):
add_browser_js(os.path.join(Millennium.steam_path(), "skins", name, theme["data"]["webkitJS"]))
add_browser_js(os.path.join(Millennium.steam_path(), "steamui", "skins", name, theme["data"]["webkitJS"]))


def setup_colors(self, file_path):
Expand Down
2 changes: 1 addition & 1 deletion assets/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def inject_webkit_shim(shim_script: str):
f.write(shim_script)
f.close()

add_browser_js(os.path.join(Millennium.steam_path(), "shim.js"))
add_browser_js("shim.js")

def get_load_config():
millennium = configparser.ConfigParser()
Expand Down
2 changes: 2 additions & 0 deletions examples/plugin/frontend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function windowCreated(context: object)
console.log(context)
}



// Entry point on the front end of your plugin
export default async function PluginMain() {

Expand Down
Loading

0 comments on commit 33b6cde

Please sign in to comment.