ghostwriter icon indicating copy to clipboard operation
ghostwriter copied to clipboard

Share links not mobile friendly and uses inline JS

Open madsolar8582 opened this issue 7 years ago • 1 comments

In the post-footer.html partial template, the Twitter, Facebook, Google+, and LinkedIn options all attempt to open a window with a specific size: https://github.com/jbub/ghostwriter/blob/2340a01fea08ecfff62ee22551741180862156ce/layouts/partials/post-footer.html#L13-L44

This does not work on mobile and might need to specifically call out about:blank as the target so that a new tab can be used.

Additionally, since the JS for the onclick event is inlined, a CSP that disables inline JS cannot be used. To make sites that use this theme more secure, the JS needs to be pulled into its own file(s) and then referenced in the page.

madsolar8582 avatar Jul 16 '18 15:07 madsolar8582

This currently works on iOS. The inlining is less than ideal. If it was desired to keep the modal window on desktop, I think the following solution is pretty elegant: https://css-tricks.com/simple-social-sharing-links/

Otherwise, tend to recommend just making them plain links that open in a new tab/window.

dylanhthomas avatar Oct 02 '20 05:10 dylanhthomas