shdwmtr / millennium

Apply themes/skins/customize Steam® after the 2023-04-27 Chromium UI update
https://steambrew.app
MIT License
1.14k stars 18 forks source link

[Bug] Patching custom webkit pages #127

Open SpaceEnergy opened 1 month ago

SpaceEnergy commented 1 month ago

Before Reporting

Describe the Bug

It is not possible to patch webkit itself with own url's (only default patching) that means if I want to patch e.g. the store page with an option it does not work

"super special option": {
            "description": "super special option description",
            "default": "yes",
            "tab": "Experimental",
            "values": {
                "no": {},
                "yes": {
                    "TargetCss": { "affects": ["https://.*.steampowered.com"], "src": "options/experimental/option.css" },
                    "TargetJs": { "affects": ["https://.*.steampowered.com"], "src": "options/experimental/option.js" }
                }
            }
        }

Expected Behavior

normal patching, i.e. CSS and JS are also patched on the specified page

Steps To Reproduce

  1. add option or patching for a webkit page (like "https://.*.steampowered.com")
  2. add some css
  3. enable option
  4. and see

Operating System

Windows

Anything else?

No response

shdwmtr commented 1 month ago

Still trying to figure out a way to do this. Unfortunetly, with the way CSS & JS is hooked, it doesn't provide any information about the url the CSS/JS is being requested from.

shdwmtr commented 1 month ago

I may have come up with a solution, but it might not be good. Ill branch it and let you test it. Once its done give me your honest opinion on it

shdwmtr commented 1 month ago

DM me on discord, I'll send you the release.

shdwmtr commented 2 weeks ago

I can't remember what happened with this issue. Does it work for you? Because it was added a few updates ago.

SpaceEnergy commented 2 weeks ago

still doesn't work for me

shdwmtr commented 2 weeks ago

what was the config you used?

SpaceEnergy commented 2 weeks ago
"VAC-Ban visibility": {
            "description": "Hide the VAC ban from your profile or on all profiles (currently not working)",
            "default": "Show",
            "tab": "Steam bloat",
            "values": {
                "Show": {},
                "For me": {
                    "TargetCss": { "affects": ["https://steamcommunity.com"], "src": "options/steamBloat/vacBan/me.css" }
                },
                "For all": {
                    "TargetCss": { "affects": ["https://steamcommunity.com"], "src": "options/steamBloat/vacBan/all.css" }
                }
            }
        },

or

"Wishlist grid": {
            "description": "Changes the view of the wishlist from a list to a grid",
            "default": "yes",
            "tab": "Experimental",
            "values": {
                "no": {},
                "yes": {
                    "TargetCss": { "affects": ["https://.*.steampowered.com"], "src": "options/experimental/wishlistGrid.css" },
                    "TargetJs": { "affects": ["https://.*.steampowered.com"], "src": "options/experimental/wishlistGrid.js" }
                }
            }
        }
shdwmtr commented 2 weeks ago

Hmm, try putting a url regex match under Patches and see if it works there

SpaceEnergy commented 2 weeks ago

is that what you mean?:

{
            "MatchRegexString": "https://.*.steampowered.com",
            "TargetCss": "webkit.css"
}
SpaceEnergy commented 2 weeks ago

whereby

        "VAC-Ban visibility": {
            "description": "Hide the VAC ban from your profile or on all profiles (currently not working)",
            "default": "Show",
            "tab": "Steam bloat",
            "values": {
                "Show": {},
                "For me": {
                    "TargetCss": { "affects": ["https://steamcommunity.com"], "src": "options/steamBloat/vacBan/me.css" }
                },
                "For all": {
                    "TargetCss": { "affects": ["https://steamcommunity.com"], "src": "options/steamBloat/vacBan/all.css" }
                }
            }
        }

will be patched but

        "Wishlist grid": {
            "description": "Changes the view of the wishlist from a list to a grid",
            "default": "yes",
            "tab": "Experimental",
            "values": {
                "no": {},
                "yes": {
                    "TargetCss": { "affects": ["https://store.steampowered.com"], "src": "options/experimental/wishlistGrid.css" },
                    "TargetJs": { "affects": ["https://store.steampowered.com"], "src": "options/experimental/wishlistGrid.js" }
                }
            }
        }

not