Mozilla today released Firefox 63, which includes an experimental option to block third-party tracking cookies to protect against cross-site tracking. You can test this today, but Mozilla wants it enabled by default in Firefox 65 for everyone.
Here, Mozilla says it works:
The newly developed policy blocks memory access for domains classified as trackers. For classification, Firefox relies on the tracking protection list managed by Disconnect. Domains that are classified as trackers can not access or set cookies, local storage, and other site data when they are loaded into a third-party context. It also prevents trackers from accessing other APIs that they can communicate with across locations, such as: For example, the broadcast channel API. These measures prevent trackers from using the cross-site identifiers stored in Firefox to link browsing activities between different sites.
This should be a better solution than just blocking all third-party cookies. Instead, it blocks only cookies associated with tracking services. Mozilla's developer documentation provides more information about how this feature works.
To enable this in the current stable version of Firefox 63 released on October 23, go to Menu> Options> Privacy and Security. Activate the "Third party cookies" option under "Choose what to block" and select "Tracker (recommended)".
Mozilla targets a release date of January 29, 2019 for Firefox 65. Of course, the feature is then not guaranteed. Mozilla says it "aims" to make this feature available to everyone by default in Firefox 65, so it may be delayed if there are any cracks that need to be worked out.
For now, if you try the feature a problem, Mozilla prompts you to report a broken website in Firefox.