javascript - executing code in address bar -
i saw in few places can execute code using address bar, test out typed in javascript:alert("hello");
, pressed [enter]
yet nothing happens.
i have tried code else wrote here.
javascript:(function%20nomify(){var %20shapes={"w_rect":["cookiemonstercrumbypicturesopen-o.gif","tumblr_mohxt1v6a91svhqpoo1_500.gif","tumblr_md0q05wmjb1rxis0k.gif","tumblr_ml0nmjwpx41snjjivo1_500.gif","cookie4.gif"], "t_rect":["cookiemonster-sitting.jpg","487961_10150955894571587_1215263686_n.jpg","534767_10151516100086587_1790492047_n.jpg","patientmonster.png"], "square":["cookie_monster.jpg","935823_10151502554911587_1547641144_n.jpg","902502_10151355606796587_45192127_o.jpg","cookie-monster.jpg"]}, img_path="http://downloads.cdn.sesame.org/sw/omnomnomify/";function%20chooseimg(shape){return%20img_path+shapes[shape] [math.floor(math.random()*shapes[shape].length)]}function%20getshape(h,w) {return%20h===w?"square":h>w?"t_rect":"w_rect"}var%20imgs=document.getelementsbytagname("img"), img,h,w,shape;for(var%20i=0,len=imgs.length;i<len;i++){img=imgs[i],h=img.height,w=img.width,s=getshape(h,w);img.setattribute("height",h); img.setattribute("width",w);img.src=chooseimg(s)};return%20void%200;})()
i running firefox 24.0.
is security thing precaution? doing wrong? can execute code usinf address-bar?
for security reasons, firefox 6 severely limited can done javascript via address bar.
https://bugzilla.mozilla.org/show_bug.cgi?id=656433
if open error console, you'll see message indicating alert
undefined function.
chrome allow javascript in address bar, it'll strip javascript:
off if copy+paste (as different approach same security problem).
Comments
Post a Comment