Tim*_*Tim 26 firefox seamonkey
例如,我有一个文本文件中的 URL 列表,
http://url1
http://url2
http://url3
Run Code Online (Sandbox Code Playgroud)
我想知道如何在 Firefox(或 SeaMonkey)中的一个选项卡中打开它们,而无需创建新选项卡、复制到地址栏并为每个 URL 回车?
我的操作系统是 Ubuntu 10.10。欢迎使用命令行和 GUI 解决方案。
Den*_*nis 32
您可以将以下内容保存到 HTML 文件中:
<!doctype html>
<html>
<head>
<title>Open Windows</title>
<script>
function openWindow(){
var x = document.getElementById('a').value.split('\n');
for (var i = 0; i < x.length; i++)
if (x[i].indexOf('.') > 0)
if (x[i].indexOf('://') < 0)
window.open('http://'+x[i]);
else
window.open(x[i]);
}
</script>
<style>
html, body
{
height : 99%;
width : 99%;
}
textarea
{
height : 80%;
width : 90%;
}
</style>
</head>
<body>
<textarea id="a"></textarea>
<br>
<input type="button" value="Open Windows" onClick="openWindow()">
<input type="button" value="Clear" onClick="document.getElementById('a').value=''">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
现在在 Firefox 中加载文件,复制文本区域中的 URL 列表并单击Open Windows
。
jhe*_*ger 24
一个简单的
firefox $(cat file.txt)
Run Code Online (Sandbox Code Playgroud)
应该足够了。firefox
只要每个链接都用空格分隔,它就会将每个链接作为参数传递给命令。
在 Windows 上,您可以创建一个批处理文件(命名为 multiurl.bat):
@echo off
for /F "eol=c tokens=1" %%i in (%1) do "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" %%i
Run Code Online (Sandbox Code Playgroud)
然后从命令行运行multiurl.bat urls.txt
,如果 FireFox 已经打开,它将在新选项卡中加载 URL,或者它将运行它然后加载 URL。
在 Mac OS X 上,将以下脚本另存为openurls.sh
,在终端中运行chmod +x openurls.sh
,然后./openurls.sh
从同一目录中键入。
#!/usr/bin/env bash
while read line ; do
open -a Firefox "$line"
done < "/path/to/file-with-urls.txt"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
26313 次 |
最近记录: |