Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

script to download blocklist

  • 8 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi 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

Tất cả các câu trả lời (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 \