iPhoneのSafariに便利なブックマークレットの使い方・設定方法まとめてみた!

公開日: : 最終更新日:2021/11/05 iPad, iPhone, まとめ記事

  『ブックマークレット』とは、Safariなどのブラウザのブックマーク機能を利用した簡易プログラムのことをいい、URLの代用として『Javascript』を指定することで、ブックマークの中の自作のブックマークレットプログラムを呼び起こす事ができます。そこで今回は、「iPhoneのSafariに便利なブックマークレットの使い方』についてまとめてみた!

【スポンサーリンク】


【『ブックマークレット』の使い方】


1、iPhoneの『Safari』を起動し、下部のステータスバーを登場させます

2、ブックマークを登録する時の要領で、適当なページをブックマークします

3、ブックマーク名前には適当なネーミングを、URLには下記のようなスクリプトを記入します

【各『ブックマークレット』の動作と種類】

・ページ全体を『Google翻訳』する方法
javascript:void(0);void(0);void(0);void(0);void('Add%20this%20text%20into%20the%
20code%20to%20suppress%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?hl=ja&sl=en&u='+q);
・ページ内全体を特定のキーワード検索する方法
javascript:void%28s%3Dprompt%28%27Find%20text
%3A%27%2C%27%27%29%29%3Bs%3D%27%28%
27+s+%27%29%27%3Bx%3Dnew%20RegExp%28s%
2C%27gi%27%29%3Brn%3DMath.floor%28Math.random
%28%29*100%29%3Brid%3D%27z%27%20+%20rn%3Bb%
20%3D%20document.body.innerHTML%3Bb%3Db.replace%28x%
2C%27%3Cspan%20name%3D%27%20+%20rid%20+%20%27%
20id%3D%27%20+%20rid%20+%20%27%20style%3D%5C%27color%
3A%23000%3Bbackground-color%3Ayellow%3B%20font-weight%3Abold
%3B%5C%27%3E%241%3C/span%3E%27%29%3Bvoid%28document.body.inner
HTML%3Db%29%3Balert%28%27Found%20%27%20+%20document.getElements
ByName%28rid%29.length%20+%20%27%20matches.%27%29%3Bwindow.scrollTo%
280%2Cdocument.getElementsByName%28rid%29%5B0%5D.offsetTop%29%3B
・地図をGoogleマップに表示する方法
javascript:(function(){var%20f=document.body.innerHTML;var%20m=
f.match(/[0-9]{2}.[0-9]{3,},[0-9]{3}.[0-9]{4,}/);if(m!=null){document
.location.href='http://maps.google.com/maps?q='+m;}else{alert
('%E5%9C%B0%E5%9B%B3%E3%81%AF%E8%A6%8B%E3%81%A4%E3%81%8B%E3%82%
89%E3%81%AA%E3%81%8B%E3%81%A3%E3%81%9F%E3%82%88%E3%81%86%E3%81%A0');}})()
・ページ内の画像のみを表示する方法
javascript:(function(){var%20imgs=document.images;var%20srcs=
new%20Array();for(var%20i=0;i%3Cimgs.length;i++){srcs.push(imgs[i].src)}
removeChildren(document.body);removeChildren(document.head);for
(var%20i=0;i%3Csrcs.length;i++){var%20div=document.createElement
('div');var%20image=document.createElement('img');image.src=srcs[i];image.
addEventListener('click',function(e){prompt('',e.target.src)},false);div.appendChild
(image);document.body.appendChild(div)}function%20removeChildren(element){element.
parentNode.replaceChild(element.cloneNode(false),element)}})();
・Google検索結果を50件表示する方法
javascript:%20location.href%20=%20location.href%20+%20'&num=50'
・特定のキーワードをWikipediaで検索する方法
javascript:(function(){var%20t=''+(window.getSelection%20?%
20window.getSelection():%20document.getSelection%20?%20document.getSelection
():%20document.selection.createRange().text);if(!t){L=document.location
.href;if(L.match(/(yahoo%5C.).+?.*p=([^&]+)/)||L.match(/(amazon%5C.).+
?.*field-%20keywords=([^&]+)/)||L.match(/(%5C.wikipedia%5C.).+%5C/wiki%5C/([^%5C/]+)/)
||L.match(/(youtube%5C.).+search_query=([^&]+)/)||L.match(/(%5C?.*%5Cb)q=([^&]+)/)||L.match
(/(%5C#search%5C/)([^%5C/]+)/))t=decodeURIComponent(RegExp.$2);}if(!t)t=prompt
("Wikipedia%E6%A4%9C%E7%B4%A2","");if(t)open
('http://ja.wikipedia.org/wiki/Search?search='+encodeURIComponent(t)+'','_blank');})()
・価格ドットコムで商品を検索する方法

javascript:(function(){var%20t=''+(window.getSelection%20?%20window.
getSelection():%20document.getSelection%20?%20document.getSelection():%
20document.selection.createRange().text);if(!t){L=document.location.href;if
(L.match(/(yahoo%5C.).+?.*p=([^&]+)/)||L.match(/(amazon%5C.).+?.*field-%20keywords=([^&]+)/)
||L.match(/(%5C.wikipedia%5C.).+%5C/wiki%5C/([^%5C/]+)/)||L.match(/(youtube%5C.).
+search_query=([^&]+)/)||L.match(/(%5C?.*%5Cb)q=([^&]+)/)||L.match(/(%5C#search%5C/)
([^%5C/]+)/))t=decodeURIComponent(RegExp.$2);}if(!t)t=prompt
("%E4%BE%A1%E6%A0%BCcom%E6%A4%9C%E7%B4%A2","");if(t)open
('http://search.kakaku.com/ksearch/search.aspx?search.x=0&search.y=0=&query='+encodeURIComponent(t)+'','_blank');})()
【スポンサーリンク】
 
【この記事を共有しませんか?】

この記事が気に入ったら
いいね ! しよう

【おすすめ記事&広告】
PAGE TOP ↑