diff options
author | Christian Schmidt <github@chsc.dk> | 2018-07-25 22:47:29 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-07-25 22:47:29 +0300 |
commit | e09383ebeedd6b6f8dee8b57373027b00e6203b5 (patch) | |
tree | 3d0faed73ba8629a52a000147b99396239cdd0ba /plugins/CoreHome/javascripts | |
parent | ef9c48cc48587776107b1500dc14eef3ffa19154 (diff) |
Replace proxy redirect with rel=noreferrer (#12780)
* Replace proxy redirect with rel=noreferrer
* Add noopener
* Restore action=redirect for non-Matomo links
* Wrap referring URLs
* NO target on download link
* Fix Github links
* Fix whitespace
* Fix tests
* Revert change
* Revert changes
* Fix tests
* Add noreferrer shim for MSIE 10
* Remove all action=redirect links
* Restore noreferrer
* Restore test
* Fix one more occurrence
* Update changelog
* Combine if's
* Fix changelog wording
* Fix stray whitespace
Diffstat (limited to 'plugins/CoreHome/javascripts')
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/noreferrer.js | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 103b9afb89..1fbae58f68 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -1722,7 +1722,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { }, handleSummaryRow: function (domElem) { - var details = _pk_translate('General_LearnMore', [' (<a href="https://matomo.org/faq/how-to/faq_54/" rel="noreferrer" target="_blank">', '</a>)']); + var details = _pk_translate('General_LearnMore', [' (<a href="https://matomo.org/faq/how-to/faq_54/" rel="noreferrer noopener" target="_blank">', '</a>)']); domElem.find('tr.summaryRow').each(function () { var labelSpan = $(this).find('.label .value'); diff --git a/plugins/CoreHome/javascripts/noreferrer.js b/plugins/CoreHome/javascripts/noreferrer.js new file mode 100644 index 0000000000..cc3b0d35a8 --- /dev/null +++ b/plugins/CoreHome/javascripts/noreferrer.js @@ -0,0 +1,18 @@ +/*! + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +$(function () { + if ($.browser.msie && parseInt($.browser.version) === 10) { + $(document).on('click', 'a[rel~="noreferrer"]', function (event) { + event.preventDefault(); + var a = event.currentTarget; + var w = window.open(a.href, a.target || '_self'); + if (/\bnoopener\b/.test(a.rel)) { + w.opener = null; + } + }); + } +}); |