Generate sharing options when the user pushes the "Share" button, not when the work page is loaded


Currently, the "Share" button on work pages is set up so that all of the sharing options are rendered and embedded in the work page, and the "Share" button just shows them (without performing another HTTP request). This means that:

  1. The server is performing unnecessary work for any user who views the work page and doesn't press the "Share" button.

  2. The twitter and tumblr buttons included in the sharing options mean that the user sends an HTTP request with AO3 listed as the referrer () to both twitter and tumblr when they view a work.

It would be good to move the sharing options off of the work page and into their own controller, to be loaded dynamically when the user presses the "Share" button.

The “Share” button is not currently presented to users who don’t have JavaScript disabled, and this behavior should continue.

Testing Instructions: Make sure that you can still use the "Share" button on works.


Stephen Burrows
April 24, 2020, 3:50 AM

Release notes comment: Improved user privacy by limiting HTTP requests to third party sites on works pages.

Testing instructions:

  1. View a work that can be shared as a logged-in user with javascript enabled and verify that the "Share" button works.

  2. View a work that can be shared as a logged-out user with javascript enabled and verify that the "Share" button works.

  3. View a work that can be shared with javascript disabled and verify that the "Share" button is not displayed.

  4. Verify in Developer Tools > Network Traffic that loading a work detail page does not cause any http requests to twitter or tumblr.

  5. Verify that visiting the share URL (/works/:id/share) for a work in an unrevealed collection does not give away any information about the work.

  6. View a work that can be shared as a logged-out user, open the share modal, close the share modal, and log in. Verify that after login you are viewing the work.

  7. View a multi-chapter work and verify that the "share" button works


June 20, 2020, 10:53 PM

Tested all of the above scenarios, and this works as expected except for #5.

I am not sure how the URL shoudl be entered as using results in a java error “Sorry, you need to have JavaScript enabled for this.” even on works where the sharing button is enabled. Going to the same url in production results in a 404 error.

I can confirm that adding a work to an unrevealed collection does remove the Share button.

June 21, 2020, 7:45 PM

The error message “Sorry, you need to have JavaScript enabled for this.” is what is wanted for an unreaveald collection

June 23, 2020, 4:16 AM

1 - 5 ok.

6 start on

open dialog, close dialog log in go to page however pressing the share button makes no change it does the same even if I don’t do that

Happy that 7 works.

6 does the same for me on beta so I think that is ok



Stephen Burrows


ticking instant





Affects versions

Fix versions






Internal 0.9