Created
September 24, 2013 09:21
-
-
Save shellexy/6682373 to your computer and use it in GitHub Desktop.
取消样式,取消禁止选择的 bookmarklet 书签工具。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
(function(){ | |
if (f=document.querySelector('frame[name="Main"]')) { | |
window.location.href = f.src; | |
} | |
document.body.style.margin = "5%"; | |
document.body.style.lineHeight = "2em"; | |
document.body.bgColor = "#F5F5B5"; | |
document.body.text = "#000000"; | |
document.onmousedown = 0; | |
document.onselectstart = 0; | |
document.oncontextmenu = 0; | |
document.body.onmousedown = 0; | |
document.body.onselectstart = 0; | |
document.body.oncontextmenu = 0; | |
for (i = 0; i < document.styleSheets.length; i++) { | |
void(document.styleSheets.item(i).disabled = true); | |
} | |
NodeList.prototype.forEach = Array.prototype.forEach; | |
NodeList.prototype.filter = Array.prototype.filter; | |
document.body.querySelectorAll(':not(a)').forEach(function(e){ e.style.cssText = 'color: black; background-color: #F5F5B5' }); | |
document.querySelectorAll('iframe').forEach(function(e){ e.style.cssText = 'width: 90%; height: 90%' }); | |
/*document.querySelectorAll('object, embed, applet').forEach(function(e){ document.body.removeChild(e) });*/ | |
document.querySelectorAll('img').forEach(function(e){ e.style.maxWidth='100%'; e.removeAttribute('width'); e.removeAttribute('height'); }); | |
document.querySelectorAll('a[style*="position: absolute"]').forEach(function(e){ e.style.cssText = "" }); | |
document.querySelectorAll('img[src$="\.jpg\.thumb\.jpg"]').forEach(function(e){e.src = e.src.replace('.jpg.thumb.jpg', '.jpg') }); | |
void 0; | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
注意,
document.querySelector
和
NodeList.prototype.forEach = Array.prototype.forEach;
NodeList.prototype.filter = Array.prototype.filter;
在有些旧版浏览器里不支持的。