dongzouxigu12345 2018-12-10 16:24
浏览 27

浏览器通知从Windows 10通知选项卡/中心打开错误的URL

currently i'm working on a notification option for my trash mail service but i get a problem with the url and window openig when i click on the notification in the windows 10 notification tab / center.

This is my function:

    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);
    }

and how i call it:

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");

When the Notification appears on the bottom right and i click on it, a new browser tabs open with the folling url: https://www.postfach2go.de/?max@postfach2go.de enter image description here

But when i open it from the Windows 10 Notification Center / Tab, a new tab is open but it only contains the host "https://www.postfach2go.de/" but without the paramter "?max@postfach2go.de" enter image description here

Does anyone know what i need to change or add so the url when opening from the Windows 10 Notification Center / Tab is: "https://www.postfach2go.de/?max@postfachgo.de" ?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥25 关于##爬虫##的问题,如何解决?:
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型
    • ¥50 buildozer打包kivy app失败
    • ¥30 在vs2022里运行python代码
    • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误