我可以在不同的窗口中打开 Tumblr 书签吗?
Tumblr 书签的代码:
javascript: var d = document,
w = window,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
f = 'http://www.tumblr.com/share',
l = d.location,
e = encodeURIComponent,
p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
u = f + p;
try {
if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
tstbklt();
}
catch (z) {
a = function () {
if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
};
if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
else a();
}
void(0)
很难解释,但这里是:
我在 Flickr 上经常使用 Tumblr 书签,但有一件事总是让我烦恼:如果您尝试打开多个共享窗口,它只会在同一个新窗口中加载页面窗户。
我只是想知道是否有任何方法可以编辑此代码以允许我打开多个窗口...
我希望我解释清楚...谢谢。
Code for Tumblr's bookmarklet:
javascript: var d = document,
w = window,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
f = 'http://www.tumblr.com/share',
l = d.location,
e = encodeURIComponent,
p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
u = f + p;
try {
if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
tstbklt();
}
catch (z) {
a = function () {
if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
};
if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
else a();
}
void(0)
Hard to explain, but here goes:
I use the Tumblr bookmarklet a lot on Flickr, but there's one thing that always annoys me: if you try to open multiple share windows, it just loads the pages in the same new window.
I'm just wondering if there's any way to edit this code to allow me to open multiple windows...
I hope I explained that clearly...thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
w.open(u, 't', ...)
更改为w.open(u, '_blank', ...)
。window.open()
的第二个参数是目标(或窗口名称)。jsFiddle。
Change
w.open(u, 't', ...)
tow.open(u, '_blank', ...)
.The second argument to
window.open()
is the target (or window name).jsFiddle.