// quasar background-hook.js
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
if (request.accessToken !== '') {
chrome.storage.local.set({ accessToken: request.accessToken }, () => {
sendResponse({ farewell: 'success' })
})
}
// Fix, Unchecked runtime.lastError: The message port closed before a response was received.
return true
})

Refer:chrome.runtime.onMessage

Refer:https://stackoverflow.com/questions/54126343/how-to-fix-unchecked-runtime-lasterror-the-message-port-closed-before-a-respon

Link:https://www.cnblogs.com/farwish/p/12236444.html

[FAQ] chrome.runtime.onMessage 问题, Unchecked runtime.lastError: The message port closed before a response was received的更多相关文章

  1. Chrome 控制台报错Unchecked runtime.lastError: The message port closed before a response was received

    Chrome浏览器控制台报错提示 Unchecked runtime.lastError: The message port closed before a response was received ...

  2. Chrome报错提示Unchecked runtime.lastError: The message port closed before a response was received.

    经过查询,此错误是Chrome扩展插件引起的.由于Chrome修改了API接口,原来的请求被拦截.(Chrome 73 onwards disallows cross-origin requests ...

  3. Unchecked runtime.lastError: The message port closed before a response was received.

    这是由于某个 Chrome 扩展程序造成的. 打开 chrome://extensions/,逐一关闭排查.我这边是由于“迅雷下载支持”这个扩展引起的,将其关闭即可.

  4. 谷歌浏览器报错Unchecked runtime.lastError: The message port closed before a response was received.。

    浏览器版本 : 报错原因:扩展程序问题 解决建议:打开chrome://extensions/,逐一关闭排查

  5. 谷歌浏览器控制台出现 Unchecked runtime.lastError: The message port closed before a response was received. 的报错

    错误截图: 解决:经过网上搜索说是浏览器扩展程序的问题,把那个扩展程序删除或者禁用就可以了

  6. Chrome Is The New C Runtime

    出处:https://www.mobilespan.com/content/chrome-is-the-new-c-runtime Chrome Is The New C Runtime Date:  ...

  7. 重写成员“log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)”时违反了继承安全性规则

    在.NET 4.0下使用最新版本的log4Net 1.2.10,会遇到下面这样的错误: 重写成员“log4net.Util.ReadOnlyPropertiesDictionary.GetObject ...

  8. iOS runtime探究(二): 从runtime開始深入理解OC消息转发机制

    你要知道的runtime都在这里 转载请注明出处 http://blog.csdn.net/u014205968/article/details/67639289 本文主要解说runtime相关知识, ...

  9. golang程序编译时提示“package runtime: unrecognized import path "runtime" (import path does not begin with hostname)”

    在编译golang的工程时提示错误的, 提示的错误信息如下: package bytes: unrecognized import path "bytes" (import pat ...

  10. iOS-浅谈runtime运行时机制-runtime简单使用(转)

    转自http://www.cnblogs.com/guoxiao/p/3583432.html 由于OC是运行时语言,只有在程序运行时,才会去确定对象的类型,并调用类与对象相应的方法.利用runtim ...

随机推荐

  1. 记录--谁还没个靠bug才能正常运行的程序

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 最近遇到一个问题,计算滚动距离,滚动比例达到某界定值时,显示mask,很常见吧^ _ ^ 这里讲的不是这个需求的实现,是其中遇到了一个比较 ...

  2. Clang RecursiveASTVisitor & ASTFrontendActions based on it

    RecursiveASTVisitor Basics 类声明 template<typename Derived> class clang::RecursiveASTVisitor< ...

  3. RMI反序列化分析

    RMI介绍 RMI全程Remote Method Invocation (远程方法引用),RMI有客户端和服务端,还有一个注册中心,在java中客户端可以通过RMI调用服务端的方法,流程图如下: 服务 ...

  4. 摄像头网页预览,不需安装插件,支持Chrome

    背景 实在是不想折腾ActiveX控件 1.麻烦(开发麻烦.使用时设置也麻烦) 2.非IE浏览器不兼容 解决方案 写一个摄像头服务,提供http服务,返回摄像头当前画面的Base64字符串,前端页面调 ...

  5. Unable to load library ‘xxx‘: 找不到指定的模块。找不到指定的模块。 Can‘t obtain InputStream for win32-x86-64/xxx.dll

    我使用的是 <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</a ...

  6. verilog之锁存器和触发器

    verilog锁存器和触发器 1.基本概念 锁存,就是输入信号变化时,输出不发生变化时,就是触发器或者锁存器.触发器的敏感信号是clk,即触发器是知道被延时了多少.对于锁存器来说,延时是不确定的.一般 ...

  7. .NET Core WebApi 多语言本地化,动态切换多语言

    .NET Core WebApi 多语言本地化,动态切换多语言 原生的.net core webapi 动态多语言本地话 具体更多详细内容,可以参考官方文档 首先看效果图 整体项目结构图 开始前需要讲 ...

  8. #KM算法#UVA1411 Ants

    题目 在一个平面直角坐标系中,有 \(n\) 个黑点,\(n\) 个白点. 给出一种二分图匹配的方案,使得没有两条由黑白点连接的线段相交 分析 如果线段都不相交,根据三角形的两边之和大于第三边,那么线 ...

  9. Java 枚举(Enums)解析:提高代码可读性与易维护性

    接口 在 Java 中,实现抽象的另一种方式是使用接口. 接口定义 接口是一个完全抽象的类,用于将具有空方法体的相关方法分组: // 接口 interface Animal { public void ...

  10. JS启动Windows上的exe

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...