hackmdio / hackmdio/hackmd-io-issues
Book mode: Assume target=_blank when frame-ancestors keeps the content from loading
- Dominant language
- No language data
- Stars
- 40
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
I've created [a demo book](https://hackmd.io/@patcon/H1p_i2jkS) demonstrating the issue with links to websites like GitHub. GitHub uses the CSP `frame-ancestors 'none'` ([docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors)), which prevents the browser from showing it. This results in a blank page and this error in console:
> Refused to display 'https://github.com/hyphacoop/organizing/blob/master/2019-06-05-all-hands-meeting.md' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
Feeling like maybe it's possible to detect this and open in a new tab. I understand that it might NOT be possible to show the proper "new tab" icon with this method, but perhaps an open source repo with a whitelist of domains could allows users to keep a manual list up-to-date, which HackMD could use to know the CSP in advance. Also, the whitelist could just be a list of test urls/domains, and a script could run nightly to determine the policy on its pages.
Anyhow, thanks for the tool, and any consideration! 🙌
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.