Marti / GM_setStyle

Here is a way to apply CSS style per element.

This is useful in case Subresource Integrity is enabled.

I might be missing here something or it is impossible to utilize pseudo-class in the fashion persented here.

Please pardon me for the mess (i.e. slice & replace).

jsonStyle = {
  // CSS stylesheet converted into JSON

list = Object.keys(jsonStyle);

for (let i = 0; i < list.length; i++) {
  for (const element of document.querySelectorAll(`${list[i]}`)) { = JSON.stringify(jsonStyle[`${list[i]}`])
      .replace(/['"]+/g, '')
      .replace(/[',]+/g, ';');

I've used this tool to convert CSS to JSON

Why was this closed?

Don't you think this is worth attention, especially when it is concerning to Userscripts and the news SRI policy?

What would be the best place to collaborate on this suggestion if not here?