Ver código fonte

Add new ext astl-open-from-clipboard

pull/15/head
10sr 9 anos atrás
pai
commit
18affc8f4d
1 arquivos alterados com 21 adições e 1 exclusões
  1. +21
    -1
      _keysnail.js

+ 21
- 1
_keysnail.js Ver arquivo

@@ -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");



Carregando…
Cancelar
Salvar