Concerned about having add-on disabled with the next update

Oh to do this equiavlent with jsonToDom you would do:

var myStylesheet = ['html:style', {},
                        '@media screen and (min-width: 640px) {',
                            '.part_playlist_spacer #watch-appbar-playlist {',
                                'margin-left: 0 !important;',
                            '}',
                        '}'
                   ];
document.head.appendChild(jsonToDOM(myStylesheet, document, {}));

kinda cool huh? :slight_smile: easy too :slight_smile: cross browser too :slight_smile:

Slightly off-topic: @noitidart
Has anyone done a performance comparison for jsonToDOM vs other methods?

That’s a good q @erosman but I never bothered because if there is a lower performance to use jsonToDOM (which I doubt) the strengths far outweigh it. Templating is absolute cake with jsonToDOM.

Only weakness of jsonToDOM is that it doesnt handle attaching multiple listneres to a specific event. Like for example, you can only add one listener to onclick, as the object is a key value pair, i was thinking of improving it, doing a test on the on* things, and if its an array then it attaches them all.