I wrote a theme for Google+. It injects CSS/Javascript to replace some colors, background images, etc. They recently seem to have renamed a lot (most) of their classes and ID’s. If I were to rewrite the code, is there a way to assign CSS (through javascript, presumably, like jquery’s .css() function) to page elements with dynamic names?
EDIT: If so, how?
Code: https://github.com/bichiliad/G-Theme
Example: I used this to replace the logo:
$(“.a-U-Pg-T img:first”).attr(‘src’, logoURL);
However, with the new update, the div enclosing the logo is now “.a-fa-bh-T”.
You could use jQuery
find()and regex patterns to try to find the elements themselves based on their hierarchy, but if the hierarchy changes then that won’t work either. And yes, you could use jQuery’scss()to apply those styles.