一覧 検索 最終更新 改名 | ヘルプ | 最終更新のRSS |

userChrome.js のバックアップソース(No.1)

(function(){
	const createButton = true
	//trueで検索ボックス右端にボタン生成 左クリックで履歴表示
	//falseで虫眼鏡ボタンを利用 右クリックで履歴表示
	
	let bar = document.getElementById('searchbar');
	let box = bar._textbox;
	let mushi = document.getAnonymousElementByAttribute(bar, 'class', 'searchbar-search-button');
	let img = 'chrome://global/skin/icons/arrow-dropdown-16.svg';
	let btn = document.createElement('toolbarbutton');
		btn.setAttribute('image', img);
		btn.setAttribute('height', '24px');
		btn.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional');
		btn.addEventListener('click', showHistory, false);
	let v = '';

    if(createButton == true){box.appendChild(btn)}
     else{mushi.addEventListener('click', showHistory, false);mushi.setAttribute('oncontextmenu', 'return(false);')}
 	
 	function showHistory(){
		if(box.value) v = box.value; box.value = '';
		box.showHistoryPopup();
		box.value = v;
		v = '';
	}
})()

(HTML conversion costs 0.003 sec.)