我在 3 个月前用 Vagrant 配置了远程 Python 解释器,当我使用它时,一切都很好,最近两天我Couldn't refresh skeletons for remote interpreter
经常收到错误,如视频所示:http : //take.ms/0Mr8b
我不确定这可能是什么错误。
环境:Vagrant Ver.2.0.0
PyCharm 2017.3.3 (Professional Edition)
Build #PY-173.4301.16, built on January 11, 2018
Licensed to my name
Subscription is active until May 23, 2018
For educational use only.
JRE: 1.8.0_152-release-1024-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.3
我们想从 Bitbucket Pipelines 迁移到 Google Cloud Build 来测试、构建和推送 Docker 镜像。
我们如何在没有 CryptoKey 的情况下使用环境变量?例如:
- printf "https://registry.npmjs.org/:_authToken=${NPM_TOKEN}\nregistry=https://registry.npmjs.org" > ~/.npmrc
Run Code Online (Sandbox Code Playgroud) 看不到我的服务工作者的日志。以下是我尝试为已注册和正在运行的 Service Worker 打开日志的步骤。
chrome://serviceworker-internals/
但是,chrome://serviceworker-internals/
ServiceWorker 检查都显示零日志。
但是,检查页面上的源选项卡显示最新代码,应该打印console.log
这是我试图查看日志的源代码
messaging.setBackgroundMessageHandler(payload => {
const title = payload.notification.title;
console.log(payload.notification);
const options = {
body: payload.notification.body,
icon: payload.notification.icon,
click_action: payload.notification.click_action || payload.data.click_action,
link: payload.notification.link || payload.data.link,
data: {
time: new Date(Date.now()).toString(),
},
};
return self.registration.showNotification(title, options);
});
self.addEventListener("notificationclick", function(event) {
const notification = event.notification;
notification.close();
console.log(notification);
const promiseChain = clients.openWindow('https://helloworld.com');
event.waitUntil(promiseChain);
});
Run Code Online (Sandbox Code Playgroud)
我使用的是 Chrome v68.0.3440.106、MacOS v10.13.6
我正在使用FCM处理推送通知,但通知是data
关键而不是notification
.
这是我用来处理新消息并显示为通知的代码.我看到了我指定的所有选项和数据的通知.但是,当我点击通知时,它不会触发任何"notificationclick"事件.它也不打印event.notification
.
importScripts('https://www.gstatic.com/firebasejs/5.3.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/5.3.1/firebase-messaging.js');
firebase.initializeApp({
messagingSenderId: "SOME_ID",
});
const messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(payload => {
console.log(payload);
const options = {
body: payload.data.body,
icon: payload.data.icon,
click_action: payload.data.click_action,
link: payload.data.link,
data: {
time: new Date(Date.now()).toString(),
click_action: payload.data.click_action,
},
};
self.registration.showNotification(payload.data.title, options);
});
self.addEventListener("notificationclick", function(event) {
console.log(event.notification);
const clickedNotification = event.notification;
clickedNotification.close();
const urlToOpen = clickedNotification.data && clickedNotification.data.click_action;
const promiseChain = clients.matchAll({
type: 'window',
includeUncontrolled: true,
})
.then((windowClients) => {
let matchingClient = null;
for (let i …
Run Code Online (Sandbox Code Playgroud) javascript firebase service-worker web-push firebase-cloud-messaging