Reapply custom twitter theme removal on ajax navigation
This commit is contained in:
parent
4f18850786
commit
a55e5a34d9
@ -24,7 +24,7 @@ if (hostname == 'facebook.com') {
|
|||||||
if (hostname == 'twitter.com') {
|
if (hostname == 'twitter.com') {
|
||||||
myself = document.querySelector('.DashUserDropdown-userInfo a');
|
myself = document.querySelector('.DashUserDropdown-userInfo a');
|
||||||
|
|
||||||
[...document.styleSheets].filter(x => x.ownerNode && x.ownerNode.id && x.ownerNode.id.startsWith('user-style')).forEach(x => x.disabled = true);
|
disableTwitterCustomCss();
|
||||||
|
|
||||||
var style = document.createElement('style');
|
var style = document.createElement('style');
|
||||||
style.textContent = `
|
style.textContent = `
|
||||||
@ -60,11 +60,16 @@ if (myself && (myself.href || myself.startsWith('http:') || myself.startsWith('h
|
|||||||
myself = getIdentifier(myself);
|
myself = getIdentifier(myself);
|
||||||
//console.log('Myself: ' + myself)
|
//console.log('Myself: ' + myself)
|
||||||
|
|
||||||
|
function disableTwitterCustomCss(){
|
||||||
|
[...document.styleSheets].filter(x => x.ownerNode && x.ownerNode.id && x.ownerNode.id.startsWith('user-style')).forEach(x => x.disabled = true);
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
updateAllLabels();
|
updateAllLabels();
|
||||||
|
|
||||||
var observer = new MutationObserver(mutationsList => {
|
var observer = new MutationObserver(mutationsList => {
|
||||||
|
if (hostname == 'twitter.com')
|
||||||
|
disableTwitterCustomCss();
|
||||||
for (var mutation of mutationsList) {
|
for (var mutation of mutationsList) {
|
||||||
if (mutation.type == 'childList') {
|
if (mutation.type == 'childList') {
|
||||||
for (var node of mutation.addedNodes) {
|
for (var node of mutation.addedNodes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user