user.js icon indicating copy to clipboard operation
user.js copied to clipboard

Preventing activity-stream.topstories.json from getting downloaded

Open Gitoffthelawn opened this issue 8 years ago • 41 comments

Even with:

user_pref("browser.newtabpage.activity-stream.enabled", false); user_pref("browser.library.activity-stream.enabled", false); // (FF57+)

Firefox 60.0b8 is downloading data to create activity-stream.topstories.json within the current profile.

UPDATE: Also activity-stream.tippytop.json

How do we make it stop?

Gitoffthelawn avatar Apr 01 '18 20:04 Gitoffthelawn

The "refreshed new tab page" has a repo

https://github.com/mozilla/activity-stream/commit/c260e0a https://github.com/mozilla/activity-stream/commit/0376728

Maybe blocking getpocket.com and getpocket.cdn.mozilla.net may help.

https://bugzilla.mozilla.org/show_bug.cgi?id=1410075 RESOLVED WONTFIX

Atavic avatar Apr 01 '18 22:04 Atavic

From DXR, "testing" setup: "Use an empty list of sites to avoid fetching"

// Use an empty list of sites to avoid fetching
user_pref("browser.newtabpage.activity-stream.default.sites", "");
user_pref("browser.newtabpage.activity-stream.telemetry", false);
user_pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", "");
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);

grauenwolfe avatar Apr 02 '18 03:04 grauenwolfe

@Thorin-Oakenpants You got me thinking... I never even see FF's newpage tab. So I forced FF to use it, and then clicked on the cog, and turned everything off. So far, no spurious files being added to the profile.

I had done that in the past, but FF must have turned everything back on when they came out with a new version of newtab.

Gitoffthelawn avatar Apr 02 '18 06:04 Gitoffthelawn

Nightly 61.0a1 about:preferences#home UI shows :

Homepage and new windows : blank page, Firefox Home (default), custom URLs New tabs : blank page, Firefox Home (default)

I set blank page for both.

Firefox Home Content : Choose what content you want on your Firefox Home screen (web search, top sites, recommended by Pocket, highlights, snippets could be un-ticked)

2glops avatar Apr 02 '18 16:04 2glops

are you telling me that a new tab can't use a custom URL

Yes. At least on the UI, I don't search about:config to find an option to do that.

2glops avatar Apr 02 '18 16:04 2glops

I'm now getting activity-stream.tippytop.json in the profile on 60.0b8. WTF.

Will try the following (NOTE: SEMICOLON MISSING IN THORIN's POST ABOVE): // hide activity stream sections (may help stop connections) user_pref("browser.newtabpage.activity-stream.showSearch", false); user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false); user_pref("browser.newtabpage.activity-stream.feeds.snippets", false); user_pref("browser.newtabpage.activity-stream.showTopSites", false); // block activity stream connections user_pref("browser.newtabpage.activity-stream.feeds.section.topstories.options", ""); // pocket <--- NOTE SEMICOLON ADDED AFTER PREF HERE user_pref("browser.newtabpage.activity-stream.telemetry.ping.endpoint", ""); // tiles service user_pref("browser.newtabpage.activity-stream.feeds.topsites", false); user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false); user_pref("browser.newtabpage.activity-stream.telemetry", false);

Gitoffthelawn avatar Apr 02 '18 18:04 Gitoffthelawn

@Thorin-Oakenpants asks: browser.newtabpage.activity-stream.telemetry.ping.endpoint points to "https://tiles.services.mozilla.com/v4/links/activity-stream"

blank it to stop?

Not enough, according to: https://github.com/mozilla/onyx/blob/master/onyx/default_settings.py#L18

Look, there are 4 CDN links -> https://tiles.cdn.mozilla.net/

activity-stream is full-off telemetry:

// These fields are sent from the client "client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e", "session_id": "{12dasd-213asda-213dkakj}", "profile_creation_date": 14786,

// These fields are generated on the server "ip": "10.192.171.13", "receive_at": 1457396660000

Source: https://github.com/mozilla/activity-stream/blob/b69291f6f37d1625134247c537d8796aae2c0695/docs/v2-system-addon/data_dictionary.md

The server is onyx

Atavic avatar Apr 02 '18 19:04 Atavic

@Gitoffthelawn You may know this already and sorry if you mentioned this and I missed it but you can just delete the activity-stream system extension from your application folder. I do this after every update or fresh install along with the other system extnesions. My about:support shows nothing under Firefox Features.

grauenwolfe avatar Apr 03 '18 00:04 grauenwolfe

@grauenwolfe No harm in mentioning it! :)

Gitoffthelawn avatar Apr 03 '18 06:04 Gitoffthelawn

just tell people to delete the xpi and change their homepage etc

:+1:

The telemetry uses ping-centre and should be covered by 0506 and 0333.

If you wanna add the prefs I'd just disable everything:

user_pref("browser.newtabpage.activity-stream.disableSnippets", true);
user_pref("browser.newtabpage.activity-stream.feeds.aboutpreferences", false); // FF61+
user_pref("browser.newtabpage.activity-stream.feeds.favicon", false);
user_pref("browser.newtabpage.activity-stream.feeds.messagecenterfeed", false); // FF61+
user_pref("browser.newtabpage.activity-stream.feeds.migration", false);
user_pref("browser.newtabpage.activity-stream.feeds.newtabinit", false);
user_pref("browser.newtabpage.activity-stream.feeds.places", false);
user_pref("browser.newtabpage.activity-stream.feeds.prefs", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories.options", "");
user_pref("browser.newtabpage.activity-stream.feeds.sections", false);
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
user_pref("browser.newtabpage.activity-stream.feeds.systemtick", false);
user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false);
user_pref("browser.newtabpage.activity-stream.feeds.theme", false); // FF61+
user_pref("browser.newtabpage.activity-stream.feeds.topsites", false);
user_pref("browser.newtabpage.activity-stream.messageCenterExperimentEnabled", false); // FF61+
user_pref("browser.newtabpage.activity-stream.migrationExpired", true);
user_pref("browser.newtabpage.activity-stream.prerender", false);
user_pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);
user_pref("browser.newtabpage.activity-stream.showSearch", false);
user_pref("browser.newtabpage.activity-stream.showSponsored", false);
user_pref("browser.newtabpage.activity-stream.showTopSites", false);
user_pref("browser.newtabpage.activity-stream.telemetry", false);
user_pref("browser.newtabpage.activity-stream.telemetry.ping.endpoint", "");
user_pref("browser.newtabpage.activity-stream.telemetry.ut.events", false);
user_pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", "");

earthlng avatar Apr 13 '18 12:04 earthlng

Which is what in this case? Deleting the XPI is nice and clean, except for the fact that it gets reinstalled at (almost) every release (which is weekly is you are on beta and daily if you are on nightly).

Gitoffthelawn avatar Apr 13 '18 14:04 Gitoffthelawn

How hard would it be to get essentially a "blank" add-on submitted to AMO with the same ID as activity stream?

Available locations, starting from the highest priority include:

    1. temporary install (about:debugging)
    2. normal user install into profile (about:addons or AMO/TestPilot/etc.)
    3. system add-on updates
    4. built-in system add-ons

This makes it possible for a developer or user to override a system add-on by installing an add-on with the same ID from AMO or TestPilot or as a temporary add-on.

https://firefox-source-docs.mozilla.org/toolkit/mozapps/extensions/addon-manager/SystemAddons.html

Was just trying to think of a way to override the .xpi file on a per-profile basis and not have to worry about the file being re-installed upon updates.

overdodactyl avatar Apr 13 '18 16:04 overdodactyl

I would have assumed the same (I'm also not very familiar with webextension development), but the documentation seems to imply it's possible, specifically:

This makes it possible for a ... user to override a system add-on by installing an add-on with the same ID from AMO

Maybe @earthlng would have a little more insight here?

overdodactyl avatar Apr 13 '18 17:04 overdodactyl

A blank xpi would be an easy and elegant set-and-forget solution for everyone but, personally, this is the kind of task I use scripts for. I don't give a shit if the xpi's keep coming back.

A likely working alternative would be to make a blank xpi and tamper with access rights to prevent it from being overwritten by Firefox, but I don't know if the latter would be OK with that.

claustromaniac avatar Apr 14 '18 00:04 claustromaniac

I was just about to look into the blank addon a bit more. Simply using the following for manifest.json works to override the [email protected] when loaded as a temporary add-on:

{

  "description": "A blank extension used to override the Activity Stream system add-on. See https://firefox-source-docs.mozilla.org/toolkit/mozapps/extensions/addon-manager/SystemAddons.html",
  "manifest_version": 2,
  "name": "Activity Stream Override",
  "version": "1.0",
  
  "applications": {
  "gecko": {
    "id": "[email protected]"
  }
}

}

I can try submitting it to AMO and see if it's rejected or not.

A script would certainly be an effective method, but personally I would like a per-profile solution (I need access to the activity stream for another repo I maintain).

overdodactyl avatar Apr 14 '18 00:04 overdodactyl

No luck submitting to AMO. I get the following from the validation report:

You cannot submit an add-on with a guid ending "@mozilla.org" or "@shield.mozilla.org" or "@pioneer.mozilla.org"

I can try using the signing API, but wouldn't be surprised if it's the same issue.

Edit: Same problem...no go via the signing API

overdodactyl avatar Apr 14 '18 01:04 overdodactyl

I just tried to upload a blank one using the id for uBO and it failed with the following error:

Your add-on failed validation with 1 error.

    * Duplicate add-on ID found.

So it doesn't look like that would be possible.

overdodactyl avatar Apr 14 '18 03:04 overdodactyl

For Windows, I have written a script that runs Firefox using Shell.Run. (It does a lot more, but we can discuss that separately.)

I'm thinking that before the Shell.Run command, to delete any unwanted Firefox Feature .xpi files.

The challenge to doing this is that the script must have admin privileges in order to delete those .xpi files.

But it seems like a real bad idea to run Firefox from an admin elevated script.

Is it? And if so, is there a way to accomplish this goal programmatically (that is, to delete the unwanted .xpi's using admin privileges, then run Firefox without any privilege escalation)?

Gitoffthelawn avatar Apr 14 '18 06:04 Gitoffthelawn

The challenge to doing this is that the script must have admin privileges in order to delete those .xpi files.

Except on Firefox portable or installations outside of Program Files, I presume.

But it seems like a real bad idea to run Firefox from an admin elevated script.

Is it? And if so, is there a way to accomplish this goal programmatically (that is, to delete the unwanted .xpi's using admin privileges, then run Firefox without any privilege escalation)?

Nowadays Firefox runs sandboxed and there are now plenty of limitations on add-ons (since webextensions came to be), so I think it should be safe enough to run elevated. Still, you know how this has always been. You can't do much against zero-day attacks before they are discovered, and running Firefox with low privileges is one of the few things you can do.

As for your second question, I searched a bit and, apparently, it can be done using runas.exe, by passing trustlevel:0x20000 to it. Still haven't tried it out.

claustromaniac avatar Apr 14 '18 15:04 claustromaniac

@claustromaniac Thanks. How do you tell if Firefox is actually running with elevated (admin) privileges?

Gitoffthelawn avatar Apr 14 '18 17:04 Gitoffthelawn