| | | | | IEbarRegPath = "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\" | | | | | | Guid = "{8287321c-032b-451d-b030-8fd617629efb}" | | | | RegPath = IEbarRegPath & Guid & "\" | | ButtonText = "执行JS" | | MenuText = "执行JS" | | MenuStatusBar = "执行JS" | | ButtonType = "Script" | | FilePath = "C:\js.htm" | | Icon = "wscript.exe,1" | | HotIcon = "wscript.exe,3" | | DefaultShow = "Yes" | | Call AddIEbar(RegPath, ButtonText, MenuText, MenuStatusBar, ButtonType, FilePath, Icon, HotIcon, DefaultShow) | | | | | | Guid = "{8287321c-032b-451d-b030-8fd617629efc}" | | | | RegPath = IEbarRegPath & Guid & "\" | | ButtonText = "Explorer" | | MenuText = "资源管理器" | | MenuStatusBar = "资源管理器" | | ButtonType = "Exec" | | FilePath = "C:\Windows\Explorer.exe" | | Icon = "C:\Windows\Explorer.exe,0" | | HotIcon = "C:\Windows\Explorer.exe,0" | | DefaultShow = "Yes" | | Call AddIEbar(RegPath, ButtonText, MenuText, MenuStatusBar, ButtonType, FilePath, Icon, HotIcon, DefaultShow) | | | | | | | | WScript.Echo "OK, 操作完成" | | | | | | Function AddIEbar(RegPath, ButtonText, MenuText, MenuStatusBar, ButtonType, FilePath, Icon, HotIcon, DefaultShow) | | dim clsid, ws | | Select Case 0 | | Case StrComp(ButtonType,"Exec",1), StrComp(ButtonType,"Script",1), StrComp(ButtonType,"ClsidExtension",1) | | clsid = "{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}" | | Case StrComp(ButtonType,"BandCLSID",1) | | clsid = "{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}" | | Case Else | | | | AddIEbar = false | | exit function | | End Select | | Set ws = WScript.CreateObject("WScript.Shell") | | ws.RegWrite RegPath & "CLSID", clsid, "REG_SZ" | | ws.RegWrite RegPath & "ButtonText", ButtonText, "REG_SZ" | | ws.RegWrite RegPath & "MenuText", MenuText, "REG_SZ" | | ws.RegWrite RegPath & "MenuStatusBar", MenuStatusBar, "REG_SZ" | | ws.RegWrite RegPath & ButtonType, FilePath, "REG_SZ" | | ws.RegWrite RegPath & "Icon", Icon, "REG_SZ" | | ws.RegWrite RegPath & "HotIcon", HotIcon, "REG_SZ" | | ws.RegWrite RegPath & "Default Visible", DefaultShow, "REG_SZ" | | set ws = nothing | | AddIEbar = true | | End FunctionCOPY |
C:\js.htm | <script language="javascript"> | | var win = window.external.menuArguments; | | var doc = win.document; | | | | function enableMouse() | | { | | if (event != null) | | { | | event.returnValue = true; | | event.cancelBubble = false; | | } | | return true; | | } | | function doEnableMouse(obj) | | { | | obj.onmousedown = enableMouse; | | obj.onmouseup = enableMouse; | | obj.onmousemove = enableMouse; | | obj.oncontextmenu = enableMouse; | | obj.onselectstart = enableMouse; | | obj.ondragstart = enableMouse; | | obj.onbeforecopy = enableMouse; | | obj.oncopy = enableMouse; | | obj.onselect = enableMouse; | | } | | function doDocument(doc) | | { | | try | | { | | doEnableMouse(doc); | | doEnableMouse(doc.body); | | var frs = doc.frames; | | if (frs != null && frs.length>0) | | { | | for (var i=0; i < frs.length; i++) | | { | | doDocument(frs[i].document); | | } | | } | | } catch(e) {} | | } | | | | | | doDocument(doc); | | | | | | if (win.location.href.search(/http:\/\/www\.google\.com\.hk/i) > -1) | | { | | var el = doc.getElementById("RemoveGoogleRedirect"); | | if (!el) | | { | | var sc = doc.createElement("script"); | | sc.id = "RemoveGoogleRedirect"; | | sc.text = "function rwt(){return true;}"; | | doc.body.appendChild(sc); | | } | | } | | | | | | var div = "<div id='zqz_tool' style='background-color:#d5d8de; background-image: url(about:blank); background-repeat: no-repeat; border-top: 1px solid #c0c3c9; bottom:0; left:0; width:100%; height:50px; line-height: 15px; padding: 0; margin: 0; font-size: 10px; text-align: center; overflow:visible; z-index:99999; position:fixed; /* for ie6 */ _position:absolute; "; | | var s = doc.documentElement.clientHeight ? true : false; | | if (s) div += "_top: expression(documentElement.scrollTop + documentElement.clientHeight - this.offsetHeight); "; | | else div += "_top: expression(body.scrollTop + body.clientHeight - this.offsetHeight); "; | | div += "'>"; | | div += "<div style='cursor: hand; border-bottom: 1px solid #a0a3a9; color: blue; height:10px; line-height: 10px; padding: 0; margin: 0; ' onclick=(function(o){if(o.parentNode.style.height!='10px'){o.parentNode.style.height='10px';o.parentNode.style.overflow='hidden';o.innerText='▲';}else{o.parentNode.style.height='50px';o.parentNode.style.overflow='visible';o.innerText='▼';}})(this)>▼</div>"; | | div +="<textarea id='zqz_cmd' rows=2 cols=80>new ActiveXObject('WScript.Shell').Run('calc');</textarea><button onclick='eval(zqz_cmd.innerText)'>eval</button>"; | | div +="<input id='zqz_external' type='checkbox' title='选中后再次点击工具栏按钮执行此代码' />外部"; | | div += '</div>'; | | doc.getElementById('zqz_tool') || doc.body.insertAdjacentHTML("beforeEnd", div); | | | | s = doc.getElementById('zqz_external'); | | s && s.checked && eval( doc.getElementById('zqz_cmd').value ); | | | | | | | | | | | | </script>COPY |
|