Closed
Bug 1271247
Opened 10 years ago
Closed 10 years ago
Remove usage of target="_blank" and use rel="noopener" in cases where it is justifiable.
Categories
(www.mozilla.org :: Pages & Content, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: espressive, Assigned: rcmainak)
Details
(Whiteboard: [good first bug])
Attachments
(1 file)
We should be cautious when using target="_blank" across the site as this can potentially cause a security vulnerability.
Would suggest that we use it only where absolutely required, and when used, we need to include the following attribute on the anchor tag:
`rel="noopener noreferrer"`
See https://mathiasbynens.github.io/rel-noopener/ for reference
Comment 1•10 years ago
|
||
+1 for doing this - the potential vulnerability is now another reason why forcing links to open in new tabs should generally be considered bad practice, past the usual UX and a11y concerns.
Here's a list of our current occurrences:
https://github.com/mozilla/bedrock/search?utf8=%E2%9C%93&q=target%3D%22_blank%22
Updated•10 years ago
|
Summary: target _blank usage → Remove usage of target="_blank" and use rel="noopener" in cases where it is justifiable.
Comment 2•10 years ago
|
||
Is this a "good first bug" candidate?
Comment 3•10 years ago
|
||
(In reply to Mike Alexis [:malexis] from comment #2)
> Is this a "good first bug" candidate?
Yep I would say most definitely
Updated•10 years ago
|
Whiteboard: [good first bug]
| Assignee | ||
Comment 4•10 years ago
|
||
Hello, I would like to contribute. I noticed that rel="noopener noreferrer" does not work in Edge, IE & Safari. Not sure how to solve this problem. Also please specify the cases where it is absolutely required to use target="_blank".
I have a silly question, the html files are written in Jinja right?
It would be my first contribution in terms of contributing to actual codebase so please guide me through the process.
Comment 5•10 years ago
|
||
(In reply to Mainak Roy Chowdhury from comment #4)
> Hello, I would like to contribute. I noticed that rel="noopener noreferrer"
> does not work in Edge, IE & Safari. Not sure how to solve this problem. Also
> please specify the cases where it is absolutely required to use
> target="_blank".
>
> I have a silly question, the html files are written in Jinja right?
>
> It would be my first contribution in terms of contributing to actual
> codebase so please guide me through the process.
Thanks for showing interest in this bug, Mainak!
I would not worry about rel="noopener noreferrer" not working in Edge/IE/Safari. We can only add protection for browsers that support it. This is all the more reason to try and remove target="_blank" where possible. There are probably only a few pages where it's strictly necessary (like the /contribute task pages). What I would suggest is just to use your own judgement as you go through the pages. We can discuss your decisions once you open a pull request and make any necessary changes from there based on discussion.
You can find the bedrock docs here to help you get set up: http://bedrock.readthedocs.io/en/latest/
If you have any trouble or any questions, best bet is to drop into #www in IRC and someone can assist you.
Assigning this bug to you, thanks!
Assignee: nobody → mozilianmainak
Status: NEW → ASSIGNED
| Assignee | ||
Comment 6•10 years ago
|
||
Great. I'll start working on it. Setting up everything will take some time. See you on IRC.
Comment 7•10 years ago
|
||
Hi Mainak,
Just checking in here, are you still working on this bug?
Flags: needinfo?(mozilianmainak)
| Assignee | ||
Comment 8•10 years ago
|
||
Yes, I'm still working on it and keeps on getting weird errors lol. I'm planning to end this work soon.
Flags: needinfo?(mozilianmainak)
Comment 9•10 years ago
|
||
Hi Mainak,
Just checking on progress here. Could you please provide a status update and indicate if you need any assistance?
Many thanks,
Eric
| Assignee | ||
Comment 10•10 years ago
|
||
I created a pull request today. There are several files which are out of my technical skills. I've added the details in the description field of the PR. Sorry for slacking. I appreciate everyone's patients. I tried make my PR perfect from the beginning, which made me redo the whole thing several times. Finally decided to not make it perfect as i don't have much experience with Django. I'm looking forward for the code review. *fingers crossed*
Oh if you're wondering here is the PR https://github.com/mozilla/bedrock/pull/4255
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
Commit pushed to master at https://github.com/mozilla/bedrock
https://github.com/mozilla/bedrock/commit/b20c87f919ec8c4795e3754e498457c4006ec303
[fix bug 1271247] Remove usage of target='_blank' and use rel='noopener'
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•