浏览器通知会从Windows 10通知标签/中心打开错误的URL

时间:2018-12-10 16:24:27

标签: php windows url browser notifications

当前,我正在为垃圾邮件服务使用通知选项,但单击Windows 10通知选项卡/中心中的通知时,URL和窗口openig出现问题。

这是我的功能:

    function spawnNotification(theBody, theIcon, theTitle, theLink) {
        var options = {
            body: theBody,
            icon: theIcon
        }
        var notification = new Notification(theTitle, options);
        notification.onclick = function(event) {
            event.preventDefault(); // prevent the browser from focusing the Notification's tab
            window.open(theLink, '_blank');
        }
        setTimeout(notification.close.bind(notification), 7000);
        console.log("URL for Noti " + theLink);
    }

以及我的称呼方式:

spawnNotification("In deinem Postfach max@postfach2go.de sind neue Emails eingetroffen.", "https://www.postfach2go.de/template/images/logo_small.png", "Neue eMails sind eingetroffen.", "?max@postfach2go.de");

当通知显示在右下角并单击它时,将打开一个新的浏览器选项卡,其中包含以下网址:https://www.postfach2go.de/?max@postfach2go.de enter image description here

但是,当我从Windows 10通知中心/选项卡中打开它时,将打开一个新选项卡,但其中仅包含主机“ https://www.postfach2go.de/”,而没有参数“ ?max@postfach2go.de” enter image description here

有人知道我需要更改或添加什么,因此从Windows 10通知中心/选项卡打开时的URL是:“ https://www.postfach2go.de/?max@postfachgo.de”吗?

0 个答案:

没有答案