Last active
November 23, 2016 09:01
-
-
Save rayantony/a0d1f7bfec36b307ec2acac7dd1edb14 to your computer and use it in GitHub Desktop.
Javascript CSS mixed file dynamic loading unloading injecting and bulk
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
| // bookmarklets from my cuyrrent firefox session aug 2016 chrubblackie | |
| //new test | |
| javascript:strList='https://d39dlwgeopmdw0.cloudfront.net/assets/web/skel.css https://cdn-static-1.medium.com/_/fp/css/main-base.z0KlLzixSjqiO0ooeem2tg.csshttps://cdn-static-1.medium.com/_/fp/js/main-base.bundle.qrVkR8Yb-53YHbfCsYTMAA.js https://rayrc.github.io/scripts/xtras.js';function cssFileIn(a){var b=a,c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("media","all"),c.setAttribute("charset","UTF-8"),c.setAttribute("href",b),document.head.appendChild(c)}function jsFileIn(a){var b=a,c=document.createElement("script");c.type="text/javascript",c.charset="UTF-8",c.async="async",c.crossorigin="anonymous",c.src=b,document.getElementsByTagName("body")[0].appendChild(c)}var strSearch=" ",filesCount,extension,newref,tempstr,filein="",strList="",strListPreWash1=strList.replace(".csshttps:",".css https:").replace(".jshttps:",".js https:").replace(".csshttp:",".css http:").replace(".jshttp:",".js http:").replace(".js//",".js //").replace(".css//",".css //").replace("http: //","http://");strPreWash2=strListPreWash1.replace(".csshttps:",".css https:").replace(".jshttps:",".js https:").replace(".csshttp:",".css http:").replace(".jshttp:",".js http:").replace(".js//",".js //").replace(".css//",".css //").replace("http: //","http://").replace(" "," "),strList=strPreWash2;for(var filein=strList.replace(" "," ").replace(" "," ").replace(" "," ").trim().split(" "),i=0;i!==filein.length;++i)switch(newref=filein[i].trim(),newref.contains(".")&&(extension=newref.substring(newref.substring().lastIndexOf("."))),extension){case".js":jsFileIn(newref);break;case".css":cssFileIn(newref);break;default:case"*":if(extension.contains(".js?")){jsFileIn(newref);break}if(extension.contains(".css?")){cssFileIn(newref);break}} | |
| //Edapte Double Click PPC Search | |
| old: javascript:var%20QUERYIS=prompt('Enter%20a%20search%20term%20or%20keyword:%20');window.location.href='http://ww1.edapte.com/?ts=fENsZWFuUGVwcGVybWludDE1fHwxODBmNnxidWNrZXQwNjB8fGJ1Y2tldDA1MHx8MHx8NTdjMzhmODEwZjBlZnx8fDE0NzI0MzQwNDkuMDc3M3w3MzE4ZjBhZDk3NTc4MjRkMzVlNmNjZGQ4YjhkOTcxYmI5ZjBkOTk5fHx8fHwxfHx8MHw1N2MzOGY4MThlNDdlYTdlN2I4YjY1MWV8fHwwfHx8fHwwfDB8fHx8fHx8fHw%3D&query='+QUERYIS+'&afdToken=CqMBChMI-YyApLzlzgIV1XgBCh2MGwIhGAMgAFDw0KABUJWizglQr8LOCVDpptAJUKCn0AlQxafQCVDqnu8SUIWE5R1Qw4CNIlDy_essUILA1DdQgLveO1CpooM9UO-hkz5Q1465PlD4kdpCUPi-vEdQ-OueTFCp4Ze3AVCr4Ze3AVCnpPPfAlDusvaGBWjw0KABcW4tV6LHfrkvkQHIgBTTPEPADBIZAG06ipDkrBdkMNXBWky-HxB-QJ5E__pnjg&search=1'; | |
| javascript:var%20QUERYIS=prompt('Enter%20a%20search%20term%20or%20keyword like CAR or LOAN:%20');window.location.href='http://ww1.edapte.com/default.php?ac=2&slt=8&slr=1&lpt=2&query='+QUERYIS+'&afdToken=Cv8BChMIrK_gu5W-0AIVU2ABCh1hZg9iGAMgAFDn2J4BUPDQoAFQjdH5AVDj4YwDUN2jhglQyqjQCVDWqNAJUNyo0AlQ6KjQCVDpqNAJUOuo0AlQ7ajQCVD2qNAJUPeo0AlQ_qjQCVCBqdAJUIKp0AlQg6nQCVCFqdAJUImp0AlQranQCVD4998RUIO_sCFQlL-wIVCR0a8_UP3bhkJQutS9QlDg9rWAAVCGw9aJAVDBq5OPAVDCpu6XAVCL48GdAVDi0-qnAVCSydW5AVDRg63VAVDKoP3zAVDE6timAlDH94yHBWjn2J4BaPDQoAFxnsFLWttA5mSRAciAFNM8Q8AMEhkAbTqKkCATNvJXFJk4y88U-6K7crXgLRen&search=1'; | |
| //mcafee | |
| javascript:(function(){var%20mybase,myurl;myurl=prompt('enter%20a%20url');mybase='http://www.mcafee.com/threat-intelligence/domain/default.aspx?domain=';location.redirect=mybase+myurl;});(function); | |
| //math | |
| javascript:alert(65536*.5); | |
| //loadunload | |
| javascript:function%20createjscssfile(filename,%20filetype){%20if%20(filetype=="js"){%20//if%20filename%20is%20a%20external%20JavaScript%20file%20%20%20var%20fileref=document.createElement('script')%20%20%20fileref.setAttribute("type","text/javascript")%20%20%20fileref.setAttribute("src",%20filename)%20}%20%20else%20if%20(filetype=="css"){%20//if%20filename%20is%20an%20external%20CSS%20file%20%20%20var%20fileref=document.createElement("link")%20%20%20fileref.setAttribute("rel",%20"stylesheet")%20%20%20fileref.setAttribute("type",%20"text/css")%20%20%20fileref.setAttribute("href",%20filename)%20}%20%20%20return%20fileref%20}%20%20function%20replacejscssfile(oldfilename,%20newfilename,%20filetype){%20var%20targetelement=(filetype=="js")?%20"script"%20:%20(filetype=="css")?%20"link"%20:%20"none"%20//determine%20element%20type%20to%20create%20nodelist%20using%20var%20targetattr=(filetype=="js")?%20"src"%20:%20(filetype=="css")?%20"href"%20:%20"none"%20//determine%20corresponding%20attribute%20to%20test%20for%20var%20allsuspects=document.getElementsByTagName(targetelement)%20for%20(var%20i=allsuspects.length;%20i>=0;%20i--){%20//search%20backwards%20within%20nodelist%20for%20matching%20elements%20to%20remove%20%20%20%20%20if%20(allsuspects[i]%20&&%20allsuspects[i].getAttribute(targetattr)!=null%20&&%20allsuspects[i].getAttribute(targetattr).indexOf(oldfilename)!=-1){%20var%20newelement=createjscssfile(newfilename,%20filetype)%20%20%20%20%20%20%20%20%20allsuspects[i].parentNode.replaceChild(newelement,%20allsuspects[i])%20%20%20%20%20}%20%20%20}%20}; | |
| ///turd in the bowl | |
| javascript:var%20myStr="bowloflotsofturdsandstuff",myMsg="bowl%20contains%20no%20turds",subStr="turd";if%20(myStr.toLowerCase().indexOf(subStr)%20!==%20-1){myMsg="oh%20yeah,%20theres%20some%20turds%20in%20the%20bowl%20for%20sure";};alert(myMsg); | |
| //bulkinj | |
| javascript:function%20cssFileIn(a){var%20b=a,c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("media","all"),c.setAttribute("charset","UTF-8"),c.setAttribute("href",b),document.head.appendChild(c)}function%20jsFileIn(a){var%20b=a,c=document.createElement("script");c.type="text/javascript",c.charset="UTF-8",c.async="async",c.crossorigin="anonymous",c.src=b,document.getElementsByTagName("body")[0].appendChild(c)}for(var%20strSearch="%20",filesCount,extension,newref,tempstr,filein="",strList=prompt("paste%20urls"),filein=strList.replace("%20%20","%20").replace("%20%20%20","%20").replace("%20%20","%20").trim().split("%20"),i=0;i!==filein.length;++i)switch(newref=filein[i].trim(),newref.contains(".")&&(extension=newref.substring(newref.substring().lastIndexOf("."))),extension){case".js":jsFileIn(newref);break;case".css":cssFileIn(newref);break;default:case"*":} | |
| //material design bootstrap builkinj | |
| javascript:function%20cssFileIn(a){var%20b=a,c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("media","all"),c.setAttribute("charset","UTF-8"),c.setAttribute("href",b),document.head.appendChild(c)}function%20jsFileIn(a){var%20b=a,c=document.createElement("script");c.type="text/javascript",c.charset="UTF-8",c.async="async",c.crossorigin="anonymous",c.src=b,document.getElementsByTagName("body")[0].appendChild(c)}for(var%20strSearch="%20",filesCount,extension,newref,tempstr,filein="",strList="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css%20http://fezvrasta.github.io/bootstrap-material-design/dist/css/bootstrap-material-design.css%20http://fezvrasta.github.io/bootstrap-material-design/dist/css/ripples.min.css%20http://cdn.rawgit.com/FezVrasta/dropdown.js/master/jquery.dropdown.css%20http://fezvrasta.github.io/bootstrap-material-design/index.css%20http://code.jquery.com/jquery-1.10.2.min.js%20http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js%20http://fezvrasta.github.io/bootstrap-material-design/dist/js/material.js%20http://fezvrasta.github.io/bootstrap-material-design/dist/js/ripples.min.js%20http://cdnjs.cloudflare.com/ajax/libs/noUiSlider/6.2.0/jquery.nouislider.min.js%20https://cdn.rawgit.com/FezVrasta/dropdown.js%20https://rayrc.github.io/xtras.js"+prompt("paste%20urls"),filein=strList.replace("%20","%20").replace("%20","%20").replace("%20","%20").trim().split("%20"),i=0;i!==filein.length;++i)switch(newref=filein[i].trim(),newref.contains(".")&&(extension=newref.substring(newref.substring().lastIndexOf("."))),extension){case".js":jsFileIn(newref);break;case".css":cssFileIn(newref);break;default:case"*":}; | |
| //statspring | |
| javascript:void(window.location='http://statspring.com/?'+window.location) | |
| //mexme | |
| javascript:void(window.location='http://webmx.me/assets/m/index.html?p=left&u='+window.location) | |
| javascript:void(window.location='http://d39dlwgeopmdw0.cloudfront.net/assets/m/index.html?p=left&u='+window.location) | |
| //bulkinjPrompt | |
| javascript:function%20cssFileIn(a){var%20b=a,c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("media","all"),c.setAttribute("charset","UTF-8"),c.setAttribute("href",b),document.head.appendChild(c)}function%20jsFileIn(a){var%20b=a,c=document.createElement("script");c.type="text/javascript",c.charset="UTF-8",c.async="async",c.crossorigin="anonymous",c.src=b,document.getElementsByTagName("body")[0].appendChild(c)}for(var%20strSearch="%20",filesCount,extension,newref,tempstr,filein="",strList=prompt("paste%20urls"),filein=strList.replace("%20%20","%20").replace("%20%20%20","%20").replace("%20%20","%20").trim().split("%20"),i=0;i!==filein.length;++i)switch(newref=filein[i].trim(),newref.contains(".")&&(extension=newref.substring(newref.substring().lastIndexOf("."))),extension){case".js":jsFileIn(newref);break;case".css":cssFileIn(newref);break;default:case"*":} | |
| //BulkInj | |
| javascript:var%20strSearch%20=%20"%20",filesCount,extension,newref,tempstr;var%20filein="";%20var%20strList%20=%20'https://gist.githubusercontent.com/rayantony/2fa7ed9ab778b86819a73dcf3e9a4e6a/raw/dfffaeb254be0fc6e7ac66ada0d12900d4854dab/xtras.js%20%20https://centurylocal.github.io/scripts/xtras3.js%20http://webmx.me/assets/web/skel.css';%20%20var%20filein=strList.replace('%20%20','%20').replace('%20%20%20','%20').replace('%20%20','%20').trim().split("%20");%20%20%20%20%20%20%20for%20(var%20i%20=%200;%20i%20!==%20filein.length;%20++i)%20{%20%20%20%20%20%20%20%20%20newref=%20filein[i].trim();%20%20%20%20%20%20%20%20%20if(newref.contains("."))%20{%20%20%20%20%20%20%20%20%20%20%20extension=%20newref.substring(newref.substring().lastIndexOf("."));%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20switch(extension)%20%20%20%20%20%20%20%20%20{%20%20%20%20%20%20%20%20%20%20%20case%20".js":%20jsFileIn(newref);debugalerts("its%20js");break;%20%20%20%20%20%20%20%20%20%20%20case%20".css":%20cssFileIn(newref);debugalerts("its%20css");break;%20%20%20%20%20%20%20%20%20%20%20default:%20%20%20%20%20%20%20%20%20%20%20case%20"*":%20break;%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20}%20function%20debugalerts(results){%20%20%20%20document.getElementById("output-data").innerHTML%20=document.getElementById("output-data").innerHTML%20+%20"<br><br>%20results:%20"+%20results;%20}%20%20function%20cssFileIn(csurl){%20var%20cssFileNew%20=%20csurl;%20var%20extCSS%20=%20document.createElement("link");%20extCSS.setAttribute("rel",%20"stylesheet");%20extCSS.setAttribute("type",%20"text/css");%20extCSS.setAttribute("media",%20"all");%20extCSS.setAttribute("charset",%20"UTF-8");%20extCSS.setAttribute("href",%20cssFileNew);%20document.head.appendChild(extCSS);%20}%20function%20jsFileIn(jsurl){%20var%20jsFileNew%20=%20jsurl;%20var%20script%20=%20document.createElement('script');%20script.type%20=%20'text/javascript';%20script.charset%20=%20'UTF-8';%20script.async%20=%20'async';%20script.crossorigin%20=%20'anonymous';%20script.src%20=%20jsFileNew;%20document.getElementsByTagName('body')[0].appendChild(script);%20} | |
| //xtras | |
| javascript:(function%20(){%20var%20style%20=%20document.createElement('style'),%20styleContent%20=%20document.createTextNode(%20'p,footer,header,a,article,soundmanager,video,input,post,h1,hr,h3{%20animation-delay:1.5s;%20animation:fly-in-from-right%200.93s%201s%20ease%20both;%20transform-origin:top%20right;%20}%20top-panels,h4,h5,img,.bottom-panels,.list-group-item,list-item,list,li,ol,shop-button,shop-item,cart,ad,dl,dt,dd,figure%20{animation-delay:1.8s;%20animation:fly-in-from-left%202.93s%201.2s%20ease%20both;%20-webkit-animation-delay:1.8s;%20-webkit-animation:fly-in-from-left%202.93s%201.5s%20ease%20both;%20transform-origin:top%20left;%20}%20@keyframes%20fly-in-from-top%20{%20from%20{%20transform:translateX(12rem)%20rotate(90deg);%20opacity:0;%20}%20}%20@keyframes%20fly-in-from-left%20{%20from%20{%20transform:translateY(12rem)%20rotate(180deg);%20opacity:0;%20}%20}%20@keyframes%20fly-in-from-right%20{%20from%20{%20transform:translateY(12rem)%20rotate(-360deg);%20opacity:0;%20}%20}'+%20'frame,iframe,section{%20animation-delay:2s;%20animation:fly-in-from-left%202s%202s%20ease%20both;%20transform-origin:top%20left;%20}%20body%20{%20font-size:%201.3em;%20line-height:%201.5;%20font-weight:%20400;%20font-family:%20"Raleway",%20"HelveticaNeue",%20"Helvetica%20Neue",%20Helvetica,%20Arial,%20sans-serif;%20-apple-system,%20BlinkMacSystemFont,%20"Segoe%20UI",%20Roboto,%20Helvetica,%20Arial,%20sans-serif,%20"Apple%20Color%20Emoji",%20"Segoe%20UI%20Emoji",%20"Segoe%20UI%20Symbol";%20color:%20#222;%20background-color:%20#fff;}%20*%20{%20box-sizing:%20border-box;%20}%20script%20{%20display:%20none;%20}html%20{%20%20-webkit-font-smoothing:%20antialiased;%20}%20%20body%20{%20margin:%200;%20padding:%200;%20-webkit-font-smoothing:%20antialiased;%20}%20%20@media%20only%20screen%20and%20(-webkit-min-device-pixel-ratio:%201.25),%20only%20screen%20and%20(%20min-device-pixel-ratio:%201.25),%20only%20screen%20and%20(%20min-resolution:%20200dpi),%20only%20screen%20and%20(%20min-resolution:%201.25dppx)%20{%20%20%20%20-webkit-font-smoothing:%20subpixel-antialiased;%20}%20%20div%20{%20margin:%200;%20padding:%200;%20position:%20absolute;%20}%20%20#mainHolder%20{%20border:%201px%20solid%20#000000;-webkit-box-sizing:%20border-box;%20-moz-box-sizing:%20border-box;%20box-sizing:%20border-box;%20background:%20#ffffff;%20cursor:%20pointer;%20overflow:%20hidden;%20%20%20%20%20-webkit-touch-callout:%20none;%20%20%20%20%20-webkit-user-select:%20none;%20%20%20%20%20-khtml-user-select:%20none;%20%20%20%20%20-moz-user-select:%20none;%20%20%20%20%20-ms-user-select:%20none;%20%20%20%20%20user-select:%20none;%20}'%20);style.appendChild(styleContent%20);%20var%20mexMeHead%20=%20document.getElementsByTagName('head');%20mexMeHead[0].appendChild(style);%20})(); | |
| //mcaffee | |
| javascript:(function(){var%20mybase,myurl;myurl=prompt('enter%20a%20url');mybase='http://www.mcafee.com/threat-intelligence/domain/default.aspx?domain=';location.redirect=mybase+myurl;});(function); | |
| // | |
| data:text/html,<script%20src="https://gist.github.com/rayantony/1beabbb1b96e39e855c8ec6c9df0629b.js"></script> | |
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
| /* ray anthony dynamic bulk injector css and js mixed bookmarklet and prompt box */ | |
| javascript:function%20cssFileIn(a){var%20b=a,c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("media","all"),c.setAttribute("charset","UTF-8"),c.setAttribute("href",b),document.head.appendChild(c)}function%20jsFileIn(a){var%20b=a,c=document.createElement("script");c.type="text/javascript",c.charset="UTF-8",c.async="async",c.crossorigin="anonymous",c.src=b,document.getElementsByTagName("body")[0].appendChild(c)}for(var%20strSearch="%20",filesCount,extension,newref,tempstr,filein="",strList=prompt("paste%20urls"),filein=strList.replace("%20%20","%20").replace("%20%20%20","%20").replace("%20%20","%20").trim().split("%20"),i=0;i!==filein.length;++i)switch(newref=filein[i].trim(),newref.contains(".")&&(extension=newref.substring(newref.substring().lastIndexOf("."))),extension){case".js":jsFileIn(newref);break;case".css":cssFileIn(newref);break;default:case"*":} |
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
| /* cache buster */ | |
| var cacheBust = ['js/StrUtil.js', 'js/protos.common.js', 'js/conf.js']; | |
| for (i=0; i < cacheBust.length; i++){ | |
| var el = document.createElement('script'); | |
| el.src = cacheBust[i]+"?v=" + Math.random(); | |
| document.getElementsByTagName('head')[0].appendChild(el); | |
| } |
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
| /* odd timing to find this after doing my bulk mixed file loader | |
| http://stackoverflow.com/questions/591685/how-can-i-dynamically-unload-a-javascript-file */ | |
| function createjscssfile(filename, filetype){ | |
| if (filetype=="js"){ //if filename is a external JavaScript file | |
| var fileref=document.createElement('script') | |
| fileref.setAttribute("type","text/javascript") | |
| fileref.setAttribute("src", filename) | |
| } | |
| else if (filetype=="css"){ //if filename is an external CSS file | |
| var fileref=document.createElement("link") | |
| fileref.setAttribute("rel", "stylesheet") | |
| fileref.setAttribute("type", "text/css") | |
| fileref.setAttribute("href", filename) | |
| } | |
| return fileref | |
| } | |
| function replacejscssfile(oldfilename, newfilename, filetype){ | |
| var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist using | |
| var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for | |
| var allsuspects=document.getElementsByTagName(targetelement) | |
| for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove | |
| if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(oldfilename)!=-1){ | |
| var newelement=createjscssfile(newfilename, filetype) | |
| allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i]) | |
| } | |
| } | |
| } |
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
| /* just a temporary pastebin of my snippets for somethin */ | |
| //turdbowl | |
| var myStr="bowloflotsofturdsandstuff",myMsg="bowl contains no turds",subStr="turd"; | |
| if (myStr.toLowerCase.indexOf(subStr) !== -1){ | |
| myMesg="oh yeah, theres some turds in the bowl for sure"; | |
| } | |
| alert(myMesg); | |
| //rayantony | |
| http://rayantony.github.io/public/css/poole.css http://rayantony.github.io/public/css/syntax.css | |
| //module format | |
| window.someModule = (function () { /* build your module components here */ return { someComponent: myComponent, anotherComponent: myOtherComponent }; }()) | |
| //awk | |
| awk '$1 == "findtext" {print $3}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment