MacOSX 或 AppleScript:从 Firefox 获取当前 URL [英] MacOSX or AppleScript: get current URL from Firefox
本文介绍了MacOSX 或 AppleScript:从 Firefox 获取当前 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从 Firefox(3 或 4)获取当前 URL?到目前为止,我发现的所有解决方案要么不起作用(例如那些带有 "class curl"
的解决方案),要么是丑陋的黑客,对我来说没有解决方案(发送按键以将 URL 复制到剪贴板).
How can I get the current URL from Firefox (3 or 4)? All solutions I have found so far either don't work (e.g. those with "class curl"
) or are ugly hacks which are no solution for me (sending key presses to copy the URL to clipboard).
推荐答案
好吧,我现在有一个解决方案:我正在从 Firefox 的当前会话存储中读取它.这有效,但它总是最多 10 秒过时.
Well, I have one solution now: I am reading it out of the current session store of Firefox. This works but it is always up to 10 seconds out-of-date.
代码如下:https://github.com/albertz/foreground_app_info/blob/master/mac/app-scripts/url%20of%20Firefox.py
这篇关于MacOSX 或 AppleScript:从 Firefox 获取当前 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文