Mozilla Firefox usercontent.css 広告カットスレ 1at SOFTWARE
Mozilla Firefox usercontent.css 広告カットスレ 1 - 暇つぶし2ch79:名無しさん@お腹いっぱい。
06/11/11 19:19:14 F1CM0Yl50
>>78
aioSelectionAsURL(); を呼べば動くでしょ。
勝手にdrag and go 仕様にしてみた。えらいてきとー。
/* Original by @authorGomita */
contentAreaDNDObserver.onDragOver = function(aEvent, aFlavour, aDragSession) {
  aEvent.target.setAttribute("dragover", "true");
  return (aDragSession.canDrop = true);
};
contentAreaDNDObserver.onDrop = function() {
  // getBrowserSelection function couldn't be apply since it removes all line breaks.
  var win = document.commandDispatcher.focusedWindow;
  var sel = win.getSelection().toString();
  if ( !sel ) return;
  // process each lines
  var flag = false;
  sel = sel.split("\n");
  sel.forEach(function(str) {
    // extract strings which may be URL (not strict)
    str = str.match(/([a-zA-Z0-9\+\$\;\?\.%,!#~\*\/:@&=_-]+)/);
    if ( !str || str[1].indexOf(".") < 0 ) return;
    str = str[1];
    if ( str.indexOf("URLリンク(")) == 0 ) str = "h" + str;
    // Open in a background tab
    gBrowser.loadOneTab(str, null, null, null, true, false);
    flag = true;
  });
  // If the selection doesn't contain URL, we does Web-Search it.
  if ( !flag )
    BrowserSearch.loadSearch(sel, true);
};
getBrowser().addEventListener("dragover", function(aEvent) { nsDragAndDrop.dragOver(aEvent, contentAreaDNDObserver); }, false);



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch