Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Hierdie gesprek is in die argief. Vra asseblief 'n nuwe vraag as jy hulp nodig het.

script to download blocklist

  • 8 antwoorde
  • 1 het hierdie probleem
  • 1 view
  • Laaste antwoord deur 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

All Replies (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 \