瀏覽代碼

Add new ext astl-open-from-clipboard

pull/15/head
10sr 9 年之前
父節點
當前提交
18affc8f4d
共有 1 個檔案被更改,包括 21 行新增1 行删除
  1. +21
    -1
      _keysnail.js

+ 21
- 1
_keysnail.js 查看文件

@@ -347,15 +347,35 @@ var autoSaveTabList = (function(){
"Tab List saved: " + filename);
}

function openFromFile(){
var file = selectFile();
openFromLFSplittedString(util.readTextFile(file));
}

function openFromClipboard(){
openFromLFSplittedString(command.getClipboardText());
}

function openFromLFSplittedString(str) {
var urls = str.split("\n");
for (var i = i; i < urls.length; i++) {
if (urls[i].match(/^http/)) {
window.openUILinkIn(urls[i], "tab");
}
}
}

return {
selectDirectory: selectDirectory,
setup: setup,
getTabList: getTabList,
saveCurrentList: saveCurrentList
saveCurrentList: saveCurrentList,
openFromClipboard: openFromClipboard
};
})();

ext.add("astl-setup", autoSaveTabList.setup, "Auto save tab list - Setup");
ext.add("astl-open-from-clipboard", autoSaveTabList.openFromClipboard, "Auto save tab list - Open tabs from clipboard");
ext.add("astl-save-current", autoSaveTabList.saveCurrentList,
"Auto save tab list - Save current list");



Loading…
取消
儲存