I run the following code in facebook.com (either with Greasemonkey/Tampermonkey). The code hides the left navigation menu, available in your general wall.
My problem:
The code works, but after executing it I cannot access my faceook conversations page.
When navigating to the conversations page by clicking the messages icon, then, "See all in messenger", my conversations page appears as a blank page.
My code:
let utilityFunc = ()=>{
let run = (run)=>{
setInterval( ()=>{
document.querySelectorAll('#left_nav_section_nodes, #pagelet_ego_pane, .ego_section').forEach((e)=>{
e.remove();
});
}, 500);
};
let pS = window.history.pushState;
let rS = window.history.replaceState;
window.history.pushState = (a, b, url)=>{
run(url);
pS.apply(this, arguments);
};
window.history.replaceState = (a, b, url)=>{
run(url);
rS.apply(this, arguments);
};
};
utilityFunc();
My question
Why would this code cause that?