-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
print the backup codes tab and not the current one #2704
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
Conversation
|
@ChristophWurst, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nickvergessen to be a potential reviewer. |
|
please backport 👍 |
|
Doesn't work here with FF: |
Works here with 50.1.0 🤔 |
|
Ouch. Doesn't work on Chromium either. |
6bc4b09 to
f86c71b
Compare
|
For some reason Chrome doesn't allow the "old" approach anymore, it closes the tab immediately if a data url is used. Now I'm using the window object to write to its document. Apparently that works on all browsers I have tested:
I don't have IE nor Safari, we should test those too as I'm not too confident that it works everywhere. Maybe @MorrisJobke or @LukasReschke can help here 😁 |
| var data = this._getDownloadData(); | ||
| var newTab = window.open('', t('twofactor_backupcodes', 'Nextcloud backup codes')); | ||
| newTab.document.write('<h1>' + t('twofactor_backupcodes', 'Nextcloud backup codes') + '</h1>'); | ||
| newTab.document.write(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @LukasReschke for possible security implications of writing to the document directly
… codes Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
8fb43ce to
3295fe2
Compare
|
rebased |
Current coverage is 53.92% (diff: 100%)@@ master #2704 diff @@
==========================================
Files 1302 1302
Lines 80097 80097
Methods 7905 7905
Messages 0 0
Branches 1245 1245
==========================================
Hits 43189 43189
Misses 36908 36908
Partials 0 0
|
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works with Firefox, Safari and Chrome 👍
|
@nickvergessen @rullzer @schiessle @LukasReschke Mind to review this one? |
Ping |
|
@ChristophWurst Please open a backport PR ;) |
Done: #3510 :-) |
Fixes #2662
Before, the current tab was printed (and closed), not the temporary one with the backup codes.
Should be backported IMO. cc @karlitschek