小编Ale*_*lii的帖子

如何在模板(动作)函数中传递异步变量?

我需要将异步变量传递给函数。像这样:

<div class="team" (click)="addToFavorite((match | async)?.id)">
Run Code Online (Sandbox Code Playgroud)

当然,我有一个错误。

解析器错误:动作表达式中不能包含管道。

也许有一种方法可以在JavaScript中转换异步变量?

asynchronous ionic2 angular

12
推荐指数
2
解决办法
6311
查看次数

忽略证书错误 + 无头木偶师 + 谷歌云

我尝试访问的网站有 ssl证书错误

我正在使用这个版本的 puppeteer "puppeteer": "1.13.0"

当我尝试时,仅在谷歌云await page.goto('http://bad_ssl_certificate_website')上出现超时错误。

超时错误:超出导航超时:

然而,它在 MAC本地运行得非常好。

我认为问题出在我的网站的 ssl-certificate-errors 上,因为如果我尝试使用“google.com”,它在两种环境中都可以正常工作。我使用https://www.sslshopper.com来检查 ssl 证书,它提到了这一点。

并非所有 Web 浏览器都信任该证书。您可能需要安装中间/链证书以将其链接到受信任的根证书。了解有关此错误的更多信息。您可以按照适用于您的服务器平台的 DigiCert 证书安装说明来修复此问题。请注意有关中级证书的部分。

当我使用旧版本的puppeteer时,我在本地也遇到了问题。我看到了完全相同的错误

“超时错误:超出导航超时:”

更新到最新版本的 puppeteer 修复了仅在本地运行 puppeteer 的问题,但尚未修复在google cloud上运行的 puppeteer

这就是我安排木偶师吃午饭的方式。

   const browser = await puppeteer.launch({
      headless: true,
      ignoreHTTPSErrors: true,
      args: [
        "--proxy-server='direct://'",
        '--proxy-bypass-list=*',
        '--disable-gpu',
        '--disable-dev-shm-usage',
        '--disable-setuid-sandbox',
        '--no-first-run',
        '--no-sandbox',
        '--no-zygote',
        '--single-process',
        '--ignore-certificate-errors',
        '--ignore-certificate-errors-spki-list',
        '--enable-features=NetworkService'
      ]
    });
Run Code Online (Sandbox Code Playgroud)

我发现了一些相关问题: https://bugs.chromium.org/p/chromium/issues/detail ?id=877075

headless ssl-certificate chromium google-cloud-functions puppeteer

10
推荐指数
2
解决办法
2万
查看次数

在 Firebase 云消息传递中,iOS 是否有替代 ttl“生存时间”的替代方法?

我正在使用 admin sdk 发送通知。

这是我的有效载荷。我能够为 Android 设置 ttl(生存时间),但我不确定如何为 iOS 设置它。

基本上,如果通知无法发送,那么我根本不想重新发送它。

         const payload = {
             notification: {
                title: 'New Appointments!',
                body: '',
              },
             data: {},
             android: {
               ttl: 1000, 
             },
             apns: {
               payload: {
                 aps: {
                   badge: 1,
                  "sound":"default"
                 },
               },
             },
            };
admin.messaging().send(payload).then((response) => {})
Run Code Online (Sandbox Code Playgroud)

ios firebase firebase-cloud-messaging

7
推荐指数
1
解决办法
3780
查看次数

是什么触发了CombineLatest?

我有一些可观察的东西。而且我需要知道哪个触发了订阅。

Observable.combineLatest(
      this.tournamentsService.getUpcoming(),
      this.favoriteService.getFavoriteTournaments(),
      this.teamsService.getTeamRanking(),
(tournament, favorite, team) => {
//what triggered combinelatest to run?
}).subscribe()
Run Code Online (Sandbox Code Playgroud)

observable rxjs combinelatest

6
推荐指数
4
解决办法
1247
查看次数