Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lewiscowles1986/e72af574565d2f10514dd34cda0794bc to your computer and use it in GitHub Desktop.
Save Lewiscowles1986/e72af574565d2f10514dd34cda0794bc to your computer and use it in GitHub Desktop.
Moving SLoyalty & LiveChat out of my way for full-page screenies
var ensure_ss = function() {
let sel = '#sloyalty-display, #livechat-compact-container, .sloyalty-tab-widget[name="sloyalty-loyalty-widget-iframe"]';
[].slice.call(document.querySelectorAll(sel)).forEach(function(elem){
elem.style.position="absolute";
});
console.log('document mutation detected')
};
var observer = new MutationObserver(ensure_ss);
observer.observe(document, { childList: true });
document.addEventListener("DOMNodeInserted", ensure_ss, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment