为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

script to download blocklist

  • 8 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 David_dls

more options

We are now serving the blocklist up internally to most of our linux workstations.

We use configuration managment and SVN. If a new blocklist is commited in SVN it can then be propagated to the server and the firefox instances will eventually see it on the internal server.

To change it I need to obtain the blocklist.xml from mozilla. I've started with a cron job which does this...

/usr/bin/curl -x OURPROXY -v https://addons.mozilla.org/blocklist/3/blocklist.xml > /some/location/NFS/blocklist.xml.$(date +\%d_\%m_\%y

But I'm not sure of that URL and seem to be getting partial files sometimes.

Please could you clarify how you would expect staff at sites serving the blocklist.xml up to obtain a new blocklist regularly?

thanks David

We are now serving the blocklist up internally to most of our linux workstations. We use configuration managment and SVN. If a new blocklist is commited in SVN it can then be propagated to the server and the firefox instances will eventually see it on the internal server. To change it I need to obtain the blocklist.xml from mozilla. I've started with a cron job which does this... /usr/bin/curl -x OURPROXY -v https://addons.mozilla.org/blocklist/3/blocklist.xml > /some/location/NFS/blocklist.xml.$(date +\%d_\%m_\%y But I'm not sure of that URL and seem to be getting partial files sometimes. Please could you clarify how you would expect staff at sites serving the blocklist.xml up to obtain a new blocklist regularly? thanks David

所有回复 (8)

more options

In Firefox you can force a new blocklist.xml file via this code in the Browser Console (Firefox/Tools > Web Developer), to see the request URl as generated from the extensions.blocklist.url pref.

Components.classes['@mozilla.org/extensions/blocklist;1'].getService(Components.interfaces.nsITimerCallback).notify(null);
more options

Hi

I get the following in the Browser console if I do that


--
[15:33:21.425] Components.classes['@mozilla.org/extensions/blocklist;1'].getService(Components.interfaces.nsITimerCallback).notify(null);

[15:33:21.426] undefined
--


To clarify: I'm after a method of downloading the blocklist outside of firefox.

Then I'll just add the new blocklist to SVN, it'll then reach the internal server which will serv it up to the clients/workstations.

thanks
David

more options

Make sure that the Net log is enabled in the Browser Console (Firefox/Tools > Web Developer) to see network requests.

This is meant to see which URL Firefox is using to get the current blocklist.xml file, so you can consider to use this to get a new file.

more options

Hi

So this doesn't work:

/usr/bin/curl -x OURPROXY -v https://addons.mozilla.org/blocklist/3/blocklist.xml > /some/location/NFS/blocklist.xml.$(date +\%d_\%m_\%y

I suspect the URL https://addons.mozilla.org/blocklist/3/blocklist.xml is not correct... please can you supply the URL to the file?

I need to obtain the file (daily via a cron job), and then place it on our internal server so clients can update.

thanks David

more options
more options

Hi cor-el

That link is exactly what I'm after - thanks.

Though, I guess it might change in future? How can I get the URL myself - Still seeing the issue when I do a force of the blocklist DL even with net logging...

[15:33:21.425] Components.classes['@mozilla.org/extensions/blocklist;1'].getService(Components.interfaces.nsITimerCallback).notify(null);

[15:33:21.426] undefined


thanks

more options

I use the Live Http Headers extension to catch the request to the update server.

You first need to open LHH and then run the JavaScript code in the browser console. Then you should see the request in the LHH window.

more options

For reference I ended up with this as the cron job command

/usr/bin/curl -L -x ourproxy -v "https://addons.mozilla.org/blocklist/3/\%7Bec8030f7-c20a-464f-9b0e-13a3a9e97384\%7D/31.0/Firefox/" > /location/to/save/in

-L handles the redirect and the %s within the URL needed escaped with \