MyBB Community Forums

Full Version: MyAlerts Issue (blocked by CORS policy)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there. After adding new myalerts_headericon template code for my theme Spectral, I received an error codeĀ in the console when clicking the alerts header icon:

jquery.js?ver=1820:2 Access to XMLHttpRequest at 'javascript:void(0)' from origin 'https://domain.net' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

When the alerts icon is clicked, the alerts "modal" will open in the footer and I will have to scroll down to view it.

myalerts_headericon:
<a href="javascript:void(0)" class="myalerts open_modal tooltip-s action-link" title="{$lang->myalerts_alerts}" data-selector="#myalerts_alerts_modal" rel="modal:open" onclick="MyBB.popupWindow('/alerts.php?modal=1&amp;ret_link={$myalerts_return_link}', { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;">
<i class="far fa-fw fa-bell"></i>
<span class="indicator" data-number="{$mybb->user['unreadAlerts']}"></span>
</a>

Any help would be great. I attempted to add https://domain.net/ to the onclick, but it did not seem to help
See if changing href="javascript:void(0)" to href="{$mybb->settings['bburl']}/alerts.php" helps.
(2019-09-21, 04:55 PM)Devilshakerz Wrote: [ -> ]See if changing href="javascript:void(0)" to href="{$mybb->settings['bburl']}/alerts.php" helps.

Did not work with the modal. Instead I uninstalled MyAlerts, installed a brand new installation of MyAlerts, replaced all files, activated again, and it is working now.

However, it did get rid of the console error, it just did not do the job properly