Skip to content

Instantly share code, notes, and snippets.

@sendarionn
sendarionn / search-on-cosnese.js
Last active July 26, 2026 03:05
GyazoのURLをCosenseで検索するブックマークレット
javascript:(function(){var currentUrl=encodeURIComponent(location.href);var newUrl='https://scrapbox.io/sendarionn/search/page?q=%27+currentUrl;window.open(newUrl,%27_blank%27);})();
@sendarionn
sendarionn / send-to-cosense.js
Created July 26, 2026 03:06
Gyazoった画像つきのCosenseページを作成するブックマークレット
javascript:(async function(){text=await navigator.clipboard.readText();newtext='['+text+']'+'\n'+location.href;window.open('https://scrapbox.io/sendarionn/'+encodeURIComponent(document.title)+'?body=%27+encodeURIComponent(newtext));})()
@sendarionn
sendarionn / add-text-and-search-on-web.js
Last active July 26, 2026 03:44
前後に文字列を追加してGoogleで検索するブックマークレット
javascript:(()=>{const selection=window.getSelection()?.toString();if(!selection)return;const prefix=prompt('検索キーワードの前に追加する文字列','');if(prefix===null)return;const suffix=prompt('検索キーワードの後ろに追加する文字列','');if(suffix===null)return;const query=`${prefix?prefix+' ':''}${selection}${suffix?' '+suffix:''}`;window.open(`https://www.google.com/search?q=${encodeURIComponent(query)}`,'_blank','noopener,noreferrer');})();
@sendarionn
sendarionn / copy-text-and-url-as-cosense-link.js
Last active July 26, 2026 03:43
選択した文字列とURLをCosneseのリンク記法でコピーするブックマークレット
@sendarionn
sendarionn / remove-line-break-and-copy.js
Last active July 26, 2026 03:36
選択した文字列の改行を除去してコピーするブックマークレット
javascript:(async()=>{const text=window.getSelection()?.toString();if(!text)return;try{await navigator.clipboard.writeText(text.replace(/\r\n?|\n/g,''));const notice=document.createElement('div');notice.textContent='改行を削除してコピー完了';Object.assign(notice.style,{position:'fixed',top:'20px',left:'50%',transform:'translateX(-50%)',padding:'8px 16px',background:'#333',color:'#fff',zIndex:2147483647,borderRadius:'4px',fontSize:'14px',pointerEvents:'none',boxShadow:'0 2px 8px rgba(0,0,0,.3)'});document.body.appendChild(notice);setTimeout(()=>notice.remove(),1500);}catch(error){console.error('コピーに失敗',error);}})();
@sendarionn
sendarionn / search-on-cosense.js
Last active July 26, 2026 03:34
選択した文字列をCosenseで検索するブックマークレット({project-name}は対象プロジェクト名で置換)
javascript:(()=>{const selection=window.getSelection()?.toString();if(!selection)return;window.open(`https://scrapbox.io/{project-name}/search/page?q=${encodeURIComponent(selection)}`,'_blank','noopener,noreferrer');})();
@sendarionn
sendarionn / search-on-web.js
Last active July 26, 2026 03:30
選択した文字列をGoogleで検索するブックマークレット
javascript:(()=>{const selection=window.getSelection()?.toString();if(!selection)return;window.open(`https://www.google.com/search?q=${encodeURIComponent(selection)}`,'_blank','noopener,noreferrer');navigator.clipboard.writeText(selection).catch(error=>console.error('コピーに失敗',error));})();
@sendarionn
sendarionn / send-youtube-to-sendarion-jukebox.js
Created July 26, 2026 03:27
開いているYouTube動画つきのCosenseページを作成するブックマークレット({project-name}は対象プロジェクト名で置換)
javascript:(function(){ var title = document.title; var cleanTitle = title.replace(/\s*-\s*YouTube$/, '').trim(); var url = encodeURIComponent(location.href); var scrapboxUrl = 'https://scrapbox.io/{project-name}/' + encodeURIComponent(cleanTitle) + '?body=[%27 + url + %27]%27; window.open(scrapboxUrl, %27_blank%27);})();