Skip to content

Instantly share code, notes, and snippets.

@sajjadmd
Created October 6, 2019 02:40
Show Gist options
  • Select an option

  • Save sajjadmd/8dd53c1159024b8501ea341205a7a755 to your computer and use it in GitHub Desktop.

Select an option

Save sajjadmd/8dd53c1159024b8501ea341205a7a755 to your computer and use it in GitHub Desktop.
SEO script to view page on-page content fast.
(function() {
document.querySelectorAll('[style]').forEach(el => el.removeAttribute('style'));
document.querySelectorAll('link[rel="stylesheet"]').forEach(el => el.parentNode.removeChild(el));
document.querySelectorAll('style').forEach(el => el.parentNode.removeChild(el));
var temp = document.createElement('div');
temp.innerHTML = `
<link rel="stylesheet" href="https://unpkg.com/chota@latest">
<style>
body { padding: 20px; }
.row { display: block; }
.col, [class*=" col-"], [class^=col-] {
margin: 0;
}
* {
text-align: left !important;
}
table td {
border: 1px solid #999;
}
img {
max-width:100%;
height:auto
}
</style>
`;
var head = document.head;
while (temp.firstChild) {
head.appendChild(temp.firstChild);
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment