Welcome to iPadForums.net Guest - Click Here to Register
iPadForums.net is the original Apple iPad Forum! Registered Users do not see these ads. Please Register - It's Free!
+ Reply to Thread
Page 1 of 6 1 2 3 ... LastLast
Results 1 to 10 of 59
Like Tree12Likes

Thread: Guide: Creating Safari Bookmarklets

  1. #1
    Super Moderator
    Member #
    13576
    Liked
    803 times
    Join Date
    Aug 2010
    Location
    Western NY state (USA)
    Posts
    9,451

    Guide: Creating Safari Bookmarklets

    You can create "bookmarklets" in Safari. Bookmarklets are, essentially, little pieces of script that you can save in Safari so you can do some short cut-like actions. For example, you can create a book mark to scroll to the bottom of the Safari web page, create a QR code of the URL so you can quickly and easily transfer the web site address to your mobile phone or you can create a book mark to get a pop-up to enter search terms for Amazon. I find they make browsing with Safari easier.

    (A) Here are the steps to make a bookmarklet
    Create a bookmark in Safari. It does not matter what page you choose, just that it is made. Title this bookmark to describe the bookmark (e.g. "Create PDF"). See this picture

    Guide: Creating Safari Bookmarklets-imageuploadedbytapatalk1334351739.217933.jpg

    2) Edit the bookmark as shown in this picture

    Guide: Creating Safari Bookmarklets-imageuploadedbytapatalk1334351767.668270.jpg

    3) Enter the Java script in the URL field as shown here (the various JavaScripts are given below):

    Guide: Creating Safari Bookmarklets-imageuploadedbytapatalk1334351805.409850.jpg

    With JavaScripts as bookmarklets, any time you are on a web page and you want to do an action, press the book mark and Safari will do its "magic."

    (B) Here are the bookmarklets I have used/am using.

    NOTE: Copy them exactly as shown here - then paste them in the URL field of your bookmark in Safari as shown above.

    Scroll to Bottom
    javascript:scroll(0,document.getElementsByTagName( %22body%22)%5B0%5D.scrollHeight);
    Search Amazon
    javascript:q=%22%22+(window.getSelection?window.ge tSelection():document.getSelection?document.getSel ection():document.selection.createRange().text);if (!q)q=prompt(%22Search%20terms?%20...%20%22,%22%22 );if(q!=null)%7Blocation=%22http://www.amazon.com/exec/obidos/external-search?mode=blended&tag=bookmardirect-20&keyword=%22+escape(q).replace(/%20/g,%22+%22);%7Delse%7Blocation=%22http://www.amazon.com/exec/obidos/redirect-home/bookmardirect-20%22;%7Dvoid%200
    Open in iCab
    javascript:location.href='web'+location.href.subst ring(4);
    Save as PDF
    javascript:pdf_url=location.href;location.href='ht tp://pdfmyurl.com?url='+escape(pdf_url)
    Send to Evernote
    javascript:(function()%7BEN_CLIP_HOST='http://www.evernote.com';try%7Bvar%20x=document.createEle ment('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')%5B0% 5D.appendChild(x);%7Dcatch(e)%7Blocation.href=EN_C LIP_HOST+'/clip.action?url='+encodeURIComponent(location.href )+'&title='+encodeURIComponent(document.title);%7D %7D)();
    Make QR Code (Link)
    javascript:location.href='http://chart.apis.google.com/chart?cht=qr&chs=300x250&chl='+encodeURIComponent( location.href);
    Add Library Books to Bluefire E-Reading App
    javascript:void%28s%3Dprompt%28%27Find%20text%3A%2 7%2C%27%27%29%29%3Bs%3D%27%28%27+s+%27%29%27%3Bx%3 Dnew%20RegExp%28s%2C%27gi%27%29%3Brn%3DMath.floor% 28Math.random%28%29*100%29%3Brid%3D%27z%27%20+%20r n%3Bb%20%3D%20document.body.innerHTML%3Bb%3Db.repl ace%28x%2C%27%3Cspan%20name%3D%27%20+%20rid%20+%20 %27%20id%3D%27%20+%20rid%20+%20%27%20style%3D%5C%2 7color%3A%23000%3Bbackground-color%3Ayellow%3B%20font-weight%3Abold%3B%5C%27%3E%241%3C/span%3E%27%29%3Bvoid%28document.body.innerHTML%3Db %29%3Balert%28%27Found%20%27%20+%20document.getEle mentsByName%28rid%29.length%20+%20%27%20matches.%2 7%29%3Bwindow.scrollTo%280%2Cdocument.getElementsB yName%28rid%29%5B0%5D.offsetTop%29%3B
    CSS Killer
    javascript:void(obj=document.getElementsByTagName( 'style'));for(i=0;i%3Cobj.length;i++){void(obj[i].disabled='true')}void(obj=document.getElementsByT agName('link'));for(i=0;i%3Cobj.length;i++){void(o bj[i].disabled='true')}void(theTags='a,abbr,acronym,add ress,applet,area,b,base,basefont,bdo,big,blockquot e,body,br,button,caption,center,cite,code,col,colg roup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,for m,frame,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i, iframe,img,input,ins,isindex,kbd,label,legend,li,l ink,map,menu,meta,noframes,noscript,object,ol,optg roup,option,p,param,pre,q,s,samp,script,select,sma ll,span,strike,strong,style,sub,sup,table,tbody,td ,textarea,tfoot,th,thead,title,tr,tt,u,ul,var');th eTags_array=theTags.split(',');for(loop=0;loop%3Ct heTags_array.length;loop++){void(theDokk=document. getElementsByTagName(theTags_array[loop]));{for(loopCount=0;loopCount%3CtheDokk.length;loo pCount++){void(theDokk[loopCount].removeAttribute('style'))}}};
    Calculator
    javascript:expr=prompt('Formula...(eg:%20%202*3%20 +%207/8%20)','');if(expr){with(Math){evl=parseFloat(eval (expr))};if(isNaN(evl)){alert('Not%20a%20number!') }else{void(prompt('Result:',evl))}}else{void(null) }
    Dictionary & Thesaurus
    javascript:var%20q=escape(window.getSelection()),i ,ii;if(!q){for(i=0;i%3Cframes.length;i++){var%20fr =frames[i];try{q=escape(fr.getSelection())}catch(e){};if(q)b reak;else{for(ii=0;ii%3Cfr.frames.length;ii++){try {q=escape(fr.frames[ii].getSelection())}catch(e){};if(q)break;}}}}if(!q)v oid(q=prompt('Enter%20word%20to%20define%3A','')); if(q)void(location.href='http://www.dictionary.com/cgi-bin/dict.pl?term='+q);
    Find in Page
    javascript:void%28s%3Dprompt%28%27Find%20text%3A%2 7%2C%27%27%29%29%3Bs%3D%27%28%27+s+%27%29%27%3Bx%3 Dnew%20RegExp%28s%2C%27gi%27%29%3Brn%3DMath.floor% 28Math.random%28%29*100%29%3Brid%3D%27z%27%20+%20r n%3Bb%20%3D%20document.body.innerHTML%3Bb%3Db.repl ace%28x%2C%27%3Cspan%20name%3D%27%20+%20rid%20+%20 %27%20id%3D%27%20+%20rid%20+%20%27%20style%3D%5C%2 7color%3A%23000%3Bbackground-color%3Ayellow%3B%20font-weight%3Abold%3B%5C%27%3E%241%3C/span%3E%27%29%3Bvoid%28document.body.innerHTML%3Db %29%3Balert%28%27Found%20%27%20+%20document.getEle mentsByName%28rid%29.length%20+%20%27%20matches.%2 7%29%3Bwindow.scrollTo%280%2Cdocument.getElementsB yName%28rid%29%5B0%5D.offsetTop%29%3B
    Improve Readability
    javascript:(function(){readStyle='style-newspaper';readSize='size-medium';readMargin='margin-medium';_readability_script=document.createElement ('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getEle mentsByTagName('head')[0].appendChild(_readability_script);_readability_css =document.createElement('LINK');_readability_css.r el='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.getElem entsByTagName('head')[0].appendChild(_readability_css);_readability_print_ css=document.createElement('LINK');_readability_pr int_css.rel='stylesheet';_readability_print_css.hr ef='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_r eadability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();
    Look Up in 1Password
    javascript:window.location=%27onepassword://%27+window.location
    Open in Atomic Web Browser
    javascript:window.location='atomic://'+location.href
    Open in iCab Web Browser
    javascript:location.href='web'+location.href.subst ring(4);
    Send to Instapaper
    javascript:function%20iprl5()%7Bvar%20d=document,z =d.createElement('scr'+'ipt'),b=d.body,l=d.locatio n;try%7Bif(!b)throw(0);d.title='(Saving...)%20'+d. title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/SrztHioaPNq1?u='+encodeURIComponent(l.href)+'&t='+ (new%20Date().getTime()));b.appendChild(z);%7Dcatc h(e)%7Balert('Please%20wait%20until%20the%20page%2 0has%20loaded.');%7D%7Diprl5();void(0)
    Save Webpage to Goodreader App
    javascript:window.location='g'+location.href
    Subscribe to RSS feed
    javascript:var%20b=document.body;var%20GR________b ookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z =document.createElement('script'));void(z.src='htt p://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{loca tion='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)}
    Split Page in Two
    javascript:document.write('%3CHTML%3E%3CHEAD%3E%3C/HEAD%3E%3CFRAMESET%20COLS=\'50%25,*\'%3E%3CFRAME%2 0SRC='%20+%20location.href%20+%20'%3E%3CFRAME%20SR C='%20+%20location.href%20+%20'%3E%3C/FRAMESET%3E%3C/HTML%3E')
    Translate (to English)
    javascript:void(0);void(0);void(0);void(0);void('A dd%20this%20text%20into%20the%20code%20to%20suppre ss%20the%20tooltip%20with%20long%20script');void(0 );void(0);void(0);void(0);void(0);void(0);void(0); q=location.href;void(location.href='http://translate.google.com/translate?u='+q);
    Wikipedia
    javascript:Qr=prompt('Search%20Wikipedia%20for','' );if(Qr)location.href='http://en.wikipedia.org/wiki/Special:Search?search='+escape(Qr)+'&fulltext=Sear ch'
    Open in Skyfire web browser
    javascript:location.href='skyfire'+location.href.s ubstring(4);
    Open in Skyfire VideoQ app
    javascript:window.location='skyfire://'+location.href
    Note that I've not tried this (I don't own VideoQ). However, it will open the Skyfire browser, so it may work for videoQ. Good luck.

    Increase Font Size (With Reflow)
    javascript:var%20p=document.getElementsByTagName(' *');for(i=0;i%3Cp.length;i++)%7Bif(p%5Bi%5D.style. fontSize)%7Bvar%20s=parseInt(p%5Bi%5D.style.fontSi ze.replace(%22px%22,%22%22));%7Delse%7Bvar%20s=12; %7Ds+=2;p%5Bi%5D.style.fontSize=s+%22px%22%7D
    Decrease Font Size (With Reflow)
    javascript:var%20p=document.getElementsByTagName(' *');for(i=0;i%3Cp.length;i++)%7Bif(p%5Bi%5D.style. fontSize)%7Bvar%20s=parseInt(p%5Bi%5D.style.fontSi ze.replace(%22px%22,%22%22));%7Delse%7Bvar%20s=12; %7Ds-=2;p%5Bi%5D.style.fontSize=s+%22px%22%7D
    Open in Photon Browser
    javascript:(function()%7Bif(document.location.href .indexOf('http')===0)document.location.href=docume nt.location.href.replace(/%5Ehttp/,'photon');%7D)();
    Page Zipper (automatically activates "Next Page" button)
    javascript:(function(){if(window['pgzp']){_pgzpToggleBookmarklet();}else{window._page_zipp er_is_bookmarklet=true;window._page_zipper=documen t.createElement('script');window._page_zipper.type ='text/javascript';window._page_zipper.src='http://www.printwhatyoulike.com/static/pagezipper/pagezipper_10.js';document.getElementsByTagName('h ead')[0].appendChild(window._page_zipper);}})();
    View Page Source
    javascript:(function(){var a=window.open('about:blank').document;a.write('Sou rce of '+location.href+'');a.close();var b=a.body.appendChild(a.createElement('pre'));b.sty le.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode(document.docu mentElement.innerHTML))})();
    This are the ones I've used at some point in the past, or am using now. If you have one you are using that's not in this list, please send me a PM and I'll get it added here.

    If I have made an error in MY copying and pasting and a JavaScript doesn't work for you, please let me know and I'll get it fixed.

    Have fun!

    Marilyn
    Last edited by Mickey330; 12-11-2012 at 08:40 PM. Reason: Added more script
    64GB WiFi/4G iPad3 (iOS 6.1.2; jailbroken w/evasi0n) & Black 32GB iPhone 5 (iOS 6.1.2, jailbroken w/evasi0n)
    * * * PLEASE READ * * * Forum Rules * * * Hacking Section Rules * * * PLEASE READ * * *

  2. Ads


  3. #2
    Super Moderator
    Member #
    14571
    Liked
    603 times
    Join Date
    Sep 2010
    Location
    Troon, Scotland
    Posts
    7,059
    Some great bookmarklets in there Marilyn. Excellent work.
    15" MacBookPro with Retina Display 16GB 3.4GHz i7 256GB | iPad4 WiFi 32GB 6.1.2 (evasi0n) | iPad3 4G 64GB 6.1.2 (evasi0n) | iPad2 3G 64GB 5.1.1 (redsn0w) | iPad1 3G 64GB 4.3.3 (jbme) |
    iPhone5 32GB 6.1.2 (evasi0n) | iPhone4S 64GB 5.1.1 (absinthe) | iPhone4 32GB 7.0b (stock) | iPhone3G 16GB 3.1.3 (jbme) | iPod Classic 6G 160GB (stock) | AppleTV 2G 5.0.2 (seas0npass)


    Please review the hacking section rules and our main rules before posting!

  4. #3
    iPF Legend
    Member #
    28530
    Liked
    624 times
    Join Date
    Jan 2011
    Location
    Dayton, WA
    Posts
    13,312
    Since I kind of railroaded you into it, I'd better say thanks too.

    And it's way better and more complete than I thought ti would be. Super job!

    Oh yeah, Thanks.

  5. #4
    iPF Novice
    Member #
    135505
    Liked
    2 times
    Join Date
    Dec 2011
    Posts
    28
    I'm just replying to this thread so I'm subscribed to it. I'm not clever enough to do that myself. I can unsubscribe, but I can't find a link in the app to subscribe.
    SueSaville likes this.

  6. #5
    iPF Legend
    Member #
    28530
    Liked
    624 times
    Join Date
    Jan 2011
    Location
    Dayton, WA
    Posts
    13,312
    Quote Originally Posted by Thescatterling View Post
    I'm just replying to this thread so I'm subscribed to it. I'm not clever enough to do that myself. I can unsubscribe, but I can't find a link in the app to subscribe.
    When reading the thread, tap the box arrow icon at the top right of screen and chose Subscribe. If you are already subscribed it will say Unsubscribe.

  7. #6
    iPad Fan
    Member #
    39716
    Liked
    12 times
    Join Date
    Mar 2011
    Location
    Santa Barbara, CA
    Posts
    206
    Thanks! These are great--such clever and useful tools!
    Bark less, wag more.

  8. #7
    iPad Junkie
    Member #
    18454
    Liked
    15 times
    Join Date
    Oct 2010
    Posts
    960
    Does anyone know if there is one to "open in" skyfire?
    32GB WIFI/3G 'The New ipad'

  9. #8
    iPF Novice
    Member #
    27496
    Join Date
    Jan 2011
    Location
    S. Florida
    Posts
    35
    Thanks for sharing!

  10. #9
    iPF Novice
    Member #
    171296
    Liked
    2 times
    Join Date
    Mar 2012
    Location
    Jakarta
    Posts
    64
    Thanks for the bookmarklets Marilyn
    Anyway, this is only works for iOS devices right???

  11. #10
    Super Moderator
    Member #
    13576
    Liked
    803 times
    Join Date
    Aug 2010
    Location
    Western NY state (USA)
    Posts
    9,451
    Quote Originally Posted by addiosamigo View Post
    Does anyone know if there is one to "open in" skyfire?
    Yeah, there is one, but it's for Skyfire VideoQ, not the actual web browser. I can put it in if you want...

    Marilyn
    64GB WiFi/4G iPad3 (iOS 6.1.2; jailbroken w/evasi0n) & Black 32GB iPhone 5 (iOS 6.1.2, jailbroken w/evasi0n)
    * * * PLEASE READ * * * Forum Rules * * * Hacking Section Rules * * * PLEASE READ * * *


+ Reply to Thread
Page 1 of 6 1 2 3 ... LastLast

Home | Forum | Active Topics | What's New

Advertisements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. safari and itunes do not open on my Ipad2. Safari icon opens up the last visited page
    By azkivanc in forum New Member Introductions - Site Assistance
    Replies: 2
    Last Post: 01-12-2012, 07:39 PM
  2. Replies: 1
    Last Post: 01-02-2012, 05:54 AM
  3. Replies: 8
    Last Post: 10-12-2011, 05:23 PM
  4. Creating a Bookmark in Safari on iPad
    By RogerNJ in forum iPad General Discussions
    Replies: 2
    Last Post: 01-24-2011, 11:20 AM
  5. Guide to creating iPad app icons?
    By leonadial in forum iPad General Discussions
    Replies: 0
    Last Post: 06-28-2010, 03:44 PM

Search tags for this page

bookmarklet for safari
,
bookmarklet in safari
,

bookmarklet safari

,
bookmarklets
,
bookmarklets for safari on macbook pro
,

bookmarklets safari

,

create bookmarklet safari

,
create safari bookmarklet
,
how to create bookmarklet in safari
,

safari bookmarklet

,
safari javascript bookmark actions
,
safari javascript bookmarklet
Click on a term to search for related topics.

Tags for this Thread