Tag: 谷歌

WebPush UnauthorizedRegistration 400尝试从节点Js发送推送通知时出错

我正尝试使用来自NodeJS的Web Push发送推送通知。 以下是我在前端获取订阅的方式: swRegistration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: "SOME_APPLICATION_PUBLIC_KEY" })….. 这里是我用来发送推送通知的NodeJS: const webpush = require('web-push'); const options = { vapidDetails: { subject: 'mailto:SOME_MAIL_ID', publicKey: 'SOME_PUBLIC_KEY', privateKey: 'SOME_PRIVATE_KEY' } }; const pushSubscription = {"endpoint":"https://fcm.googleapis.com/fcm/send/SOME_END_POINT","keys{"p256dh":"SOME VALUE","auth":"SOME_VALUE"}}; webpush.sendNotification(pushSubscription, "Test Notification", options) .then(function(response) { console.log(response) }) .catch(function(error) {console.log(error)}); 然后我得到一个400错误。 我已经交叉validation了我的gcm_sender_id和我的服务器密钥。 一切看起来不错,通知在Firefox中testing正常工作,并在Chrome中失败。 这是我得到的错误: name: 'WebPushError', message: 'Received unexpected response code', statusCode: […]

即使提交基于PRG的表单,Chrome浏览器也会追踪2条历史logging

当提交实现“发布+相同页面redirect+获取”方法的表单时,Chrome跟踪两个历史logging条目 – 而不仅仅是一个 – 。 演示这个奇怪的行为的步骤。 1 – 我浏览到表单页面裸页面:demo.html。 裸页面: 2 – 我填写表格。 填写表单: 3 – 我提交表格。 Submited – 这是空的forms(在demo.html,redirect从我的基于PRG的redirect到相同的page.php): 4 – 我点击浏览器的“返回”button一次。 Chrome跳回填充表格(步骤) 5 – 我需要再次点击浏览器的“返回”button才能到达我浏览页面之前(例如我的浏览器的“谷歌”默认页面): Chrome(版本25.0.1364.172)和Safari(6.0.2) 我在期待什么 我期望有一个单一的浏览器的“返回”点击到达窗体之前的页面。 实际上,Firefox(19.0.2)Opera(12.11)和IE(从版本6到最新的10)是如何运行的。 我的源代码 demo.html <!DOCTYPE html> <html lang="en"> <head> </head> <body> <form action="redirect-to-same-page.php" method="post"> Type something and submit: <input type="text" name="something" /> <!– optional: autocomplete="off" –> […]