我想找到或创建一个可以根据页面标签中的文本创建并保存到文件夹的Firefox扩展程序。
我希望它能够做到以下几点:
a. Check the page's html for a certain tag name (e.g. <itemName>),
b. Use a regular expression to look for a text pattern within the tag mentioned above (e.g. first and last name like - <itemName>Abe Lincoln</itemName>),
c. Compare that pattern to folders already existing on the computer,
c-i. If the folder exists, then just save the file (from a certain domain, in certain tag, etc) from the page to that folder,
c-ii. If the folder does not exist, then create it and then save the aforementioned file from the page to that folder.
d. Close the page/tab.
我一直在网上搜索这样的东西,但到目前为止,我还没有找到可以做到这一点的东西。有这样的事吗? 如果没有,是否可以创建一个可以使用正则表达式的扩展,就像我需要的那样?
感谢您的帮助。
答案 0 :(得分:1)
不知道是否存在这样做的现有扩展,但是你可以在firefox扩展使用支持正则表达式的javascript的firefox扩展中轻松使用正则表达式
开发firefox扩展是一项简单的任务,你可以搜索tuts,如果你愿意,这里是一个很好的开始
http://blog.mozilla.org/addons/2009/01/28/how-to-develop-a-firefox-extension/
同样可以肯定的是,您需要developer.mozilla以获取最佳细节