ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

web: Fix the config negotation between self-hosted and the extension

Open danielhjacobs opened this issue 1 year ago • 2 comments

danielhjacobs avatar Aug 02 '24 17:08 danielhjacobs

I've thought about this before, and never added it because it just didn't feel right. Today looking at it in code, I'm still a little hesitant.

I think I'd prefer something like ruffle.configs as an array of configs + a new field "priority", where the existing config is an implicit entry at prio 0. We build loadedConfig by iterating the configs and merging them - sorted by prio ascending.

We can then in the extension have some things that don't override the websites wishes (insert with low prio), and some that do (insert with high prio). Log level absolutely should change the log level, but "download swf" is the only debatable one afaik.

Websites like the wayback machine can then also use this to better give their preferences without a website replacing their wishes. Assuming, of course, a website doesn't just blindly go RufflePlayer.configs = []. We should only document it in the tsdocs and give proper usage guidelines. (Ofc the same issue is present with this pr - someone could just RufflePlayer.extensionConfig = {} too... or just RufflePlayer = {})

Dinnerbone avatar Aug 06 '24 19:08 Dinnerbone

but "download swf" is the only debatable one afaik.

The browser is still the user agent. You host it publicly, I can access it. If I can access it to play it, my browser will store it anyway in it's cache, so if I want to, I will keep it to myself. No need/point to make it unnecessary complicated by me having to open the network tab in the developer tools or whatever...

torokati44 avatar Aug 08 '24 20:08 torokati44