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

Description

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.

Activity

Show:
Stephen Burrows
April 23, 2020, 5:50 PM
Edited

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

 

Runt
June 20, 2020, 12: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 https://test.archiveofourown.org/works/1067828/share 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.

james_
June 21, 2020, 9:45 AM

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

james_
June 22, 2020, 6:16 PM
Edited

1 - 5 ok.

6 start on https://test.archiveofourown.org/works/606217

open dialog, close dialog log in go to page https://test.archiveofourown.org/users/zz9pzza 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

DeployedToBeta

Assignee

Stephen Burrows

Reporter

ticking instant

Roadmap

Works

Priority

Medium

Affects versions

Fix versions

Components

BackEnd
FrontEnd

Difficulty

Medium

Milestone

Internal 0.9
Configure