Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When shorten the url, link should be opened in a new window #1297

Open
Ervoconite opened this issue May 3, 2024 · 1 comment
Open

When shorten the url, link should be opened in a new window #1297

Ervoconite opened this issue May 3, 2024 · 1 comment

Comments

@Ervoconite
Copy link

The problem

When shorten the url,link should be opened in new window !

If not, and since I click the new generated url, I may never find it again !

The solution

Setup the shroted link, just like below:

js/privatebin.js: insert after line(2154)

$pasteUrl[0].target = "_blank";

tpl/bootstrap.php: update SRI line(76)

<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-naSnfYqE+TO7YZVHhBfwPQqH+l2h5Xa0ut90DgsZElFxTpCFhxUOkOZU8YLEvETndxlLRJFtuKMat1aLecpQ5Q==" crossorigin="anonymous"></script>

@rugk
Copy link
Member

rugk commented May 3, 2024

Sounds like a reasonable change? For older browsers that have this systemtic vuln we should probably also set rel=noopener, though that is no issue if we adjust this.

Any other opinion?

BTW @Ervoconite if you are not scared to generate the SRI hashes (docs here), feel free to submit a PR and you will automatically also get the credit for the commits etc.

@rugk rugk changed the title When shorten the url,link should be opened in new window ! When shorten the url, link should be opened in a new window May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants