CSP for bookmarklet (subscription)

https://github.com/FreshRSS/FreshRSS/issues/1075
This commit is contained in:
Alexandre Alapetite
2016-02-21 18:06:32 +01:00
parent 264d05297c
commit b486414988
2 changed files with 8 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
</li>
<li class="item">
<a onclick="return false;" href="javascript:(function(){var%20url%20=%20location.href;window.open('<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&amp;url_rss='+encodeURIComponent(url), '_blank');})();">
<a class="bookmarkClick" href="javascript:(function(){var%20url%20=%20location.href;window.open('<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&amp;url_rss='+encodeURIComponent(url), '_blank');})();">
<?php echo _t('sub.menu.bookmark'); ?>
</a>
</li>

View File

@@ -1245,6 +1245,12 @@ function init_configuration_alert() {
});
}
function init_subscription() {
$('body').on('click', '.bookmarkClick', function (e) {
return false;
});
}
function parseJsonVars() {
var jsonVars = document.getElementById('jsonVars'),
json = JSON.parse(jsonVars.innerHTML);
@@ -1281,6 +1287,7 @@ function init_all() {
init_notifs_html5();
window.setInterval(refreshUnreads, 120000);
} else {
init_subscription();
init_crypto_form();
init_share_observers();
init_remove_observers();