namespaces - Using twitter bootstrap in bookmarklets - CSS affecting rest of the page -
i injecting twitter bootstrap bookmarklet i'm making, css overriding existing stylesheets on page. want apply markup generated bookmarklet. @ possible? if so, how can accomplish it?
have bookmarklet create own <object>
, inject bootstrap , markup data
attribute data uri
:
void ( function disable_and_replace_bootstrap() { "use strict"; var css_markup = '<link rel="stylesheet" type="text/css" href="https://getbootstrap.com/dist/css/bootstrap.min.css"/>'; var bootstrap_markup = "<h1 class='h6'>hi</h1><h6 class='h1'>bye</h6>"; var newobj = document.createelement("object"); newobj.setattribute("width", "100px"); newobj.setattribute("height", "100px"); document.body.innerhtml = bootstrap_markup; newobj.setattribute("data", "data:text/html,"+css_markup+bootstrap_markup); document.body.appendchild(newobj); }() )
references
Comments
Post a Comment