This extension allows us to run scripts when the page loads
We can specify any javascript in the options, that we want to execute on document load,
we can make it conditional based on window.href etc.
e.g. stop videos autoload.
<code>
// this list is auto-updated
var videos = document.getElementsByTagName("video" );
function stopVideosPreload(){
for( var j=0; j< videos.length; j++){
videos[j].preload = "none";
}
}
var obs = new MutationObserver( function(mutations, observer){
stopVideosPreload();
}
);
obs.observe( document.body, { childList:true, subtree:true });
</code>
Latest reviews
- (2021-12-01) Vadym Milichev: Decent solution for dirty tasks! :) Suppose, you hate Jira and its unavoidable habit to enter the edit mode on the description click. So you just save this chunk in the extension options, and that's it: only ⌘+Click opens the editor! document.addEventListener('click', ((event)=>{ if (event.metaKey || event.ctrlKey || document.body.id !== 'jira') { return; } let e = event.target; let contentWrapperFound; while (e && e !== document && e.tagName !== 'A') { if (!contentWrapperFound && ( e.matches('div[class^="ContentWrapper_"]') || e.matches('div[class^="ak-renderer-document"]') )) { contentWrapperFound = true; } else if (e.matches('div[role="presentation"]')) { if (contentWrapperFound) { console.log("CLICKED TO NOT EDIT, hold ctrl/cmd if you really want the thing to happen"); event.preventDefault(); event.stopPropagation(); return false; } else { break; } } e = e.parentNode; } } ), { capture: true });
- (2021-10-16) windmaomao: Very good, thanks for taking the time to do things this basic.
- (2021-03-03) Will Ediger: Did the job. Would love more customization, but can't complain about having a simple job to do the trick in a pinch.
- (2020-12-18) Mehdi Rad: Cool for pro Ads Removal
- (2020-08-13) Alisherbek Rakhimov: Please add a feature onloading specific scripts with specific websites, facebook -> some script, instagram another script. But you have one general script to all, for example if I want to remove some block of code(div with some class) on instagram, and if facebook have the same div with the same class your extension must not touch facebook, so that i want it only work for instagram, so please, add this feature ASAP.
Statistics
Installs
628
history
Category
Rating
4.8 (8 votes)
Last update / version
2016-04-05 / 1.0
Listing languages
en