Jonathan Mayer, a researcher at Stanford, has contributed a patch for Firefox that will block third-party cookies from installing on the user's browser. The patch is set to be incorporated into Firefox 22. (Update: while the "target milestone" for this patch is version 22, Mozilla reached out to us on Monday to say that it can't confirm the exact date or version in which the patch will be officially incorporated). For some sense of timing on the project, Firefox 19 was released on Tuesday.

With the patch, Firefox would allow all cookies from sites that a user actively visits, but it would block cookies from third-party sites if a user has not visited that cookie's origin site. Advertisers generally place third-party cookies and can collect data about a user across several websites with them. This is used to serve more targeted ads or refine where an advertising firm should spend its money.

Blocking third-party cookies would not be new or unheard of among browsers; Apple's Safari already rejects cookies from third parties. In a blog post on Friday, Mayer called the Firefox patch “a slightly relaxed version of the Safari policy.” Chrome allows all cookies, and Internet Explorer blocks some third-party cookies, although not all.

The balance between user privacy and money from advertisers has been difficult to strike. Last February, the US suggested companies agree to an “Internet Privacy Agreement” that would protect users who added themselves to a “Do Not Track” list. Despite the publication of that agreement, little real change has occurred in companies' practices. In May 2012, the UK enacted an almost pointlessly broad “cookie law,” which required users' consent to install cookies—although “consent” was later redefined as “implied consent” which meant if a user visited a site for the first time, and that site showed a notice that it was serving cookies to the user's browser, and the user took no action, that meant that the user had consented to that site's cookies.

Users can already manually disable cookies in Firefox, but in a future version it will be an automatically enabled feature.