草庐IT

VC_runtime

全部标签

javascript - 为什么内容脚本中未定义 chrome.runtime?

我有一个非常简单的chrome扩展程序,我试图将消息从后台脚本传递到内容脚本。但是chrome.runtime是未定义的。这实际上是所有代码,如您所见,几乎没有任何内容。在内容脚本中,运行时未定义。背景脚本:chrome.browserAction.onClicked.addListener(function(tab){chrome.runtime.sendMessage({action:'someAction'},function(response){console.log('Response:',response);});});内容脚本:chrome.runtime.onMessa

javascript - IE9 中的 Jquery 2.1.1 出现错误 : 0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'

使用VisualStudio2013,我将一个混合的Asp.NetWebforms/MVC3Web应用程序迁移到Asp.NetWebforms/MVC5.1。作为迁移的一部分,我使用NuGet包管理器将Jquery从1.9.1升级到2.1.1。当我在Chrome的VisualStudio2013调试器中运行应用程序时,我没有遇到任何问题。当我在IE9的VisualStudio2013调试器中运行应用程序时(兼容模式未打开),首先加载带有这两个脚本标记的母版页:由于此Javascript错误而失败:Unhandledexceptionatline3425,column4inhttp://

javascript - chrome.runtime.sendMessage 在 Chrome 扩展程序中不起作用

我正在尝试创建一个新的扩展。不久前我能够使用chrome.runtime.sendMessage函数,但现在,我已经尝试了所有方法,但它仍然无法将消息发送到后台脚本。控制台正在填充来自content-script.js但不是来自background.js的日志消息content-script.jsconsole.log("HelloWorld!s");$(document).ready(function(){console.log("DOMREADY!");$(document.documentElement).keydown(function(e){console.log("KeyH

javascript - chrome.runtime.getURL 与 chrome.extension.getURL

chrome.runtime.getURL之间有什么区别?和chrome.extension.getURL?文档暗示chrome.runtime.getURL在应用程序和扩展程序中都有效,并且this2012announcement表示某些API(尽管不是getURL)已从chrome.extension移动到chrome.runtime。chrome.extension.getURL有什么意义,为什么不弃用chrome.runtime.getURL? 最佳答案 chrome.extension.getURL现已弃用,您应该使用ch

javascript - "Assertion failed: you need to wait for the runtime to be ready"在JavaScript中调用C函数时出错

我正在尝试一个简单的示例来调用使用JavaScript编译为.wasm的C函数。这是counter.c文件:#includeintcounter=100;EMSCRIPTEN_KEEPALIVEintcount(){counter+=1;returncounter;}我使用emcccounter.c-sWASM=1-ocounter.js编译了它。我的main.jsJavaScript文件:constcount=Module.cwrap('count','number');console.log(count());我的index.html文件只加载正文中的两个.js文件,没有别的:我得

javascript - 内容脚本中的 chrome.runtime.sendMessage 不发送消息

我有以下文件(gist以便于访问):list.json{"name":"testmessage","version":"0.1","manifest_version":2,"externally_connectable":{"matches":["*://www.google.com/*"]},"background":{"scripts":["background.js"],"persistent":true},"content_scripts":[{"matches":["*://www.google.com/*"],"js":["content.js"]}]}content.js

go - 为什么在 runtime.GOMAXPROCS(1) 时单个 goroutine 比多个 goroutine 运行得慢?

我只是想试试goroutine切换上下文的速度有多快,所以写了下面的代码。令我惊讶的是,多个gorountines比不需要切换上下文的版本运行得更快(我将程序设置为仅在一个CPU内核中运行)。packagemainimport("fmt""runtime""sync""time")funcmain(){runtime.GOMAXPROCS(1)t_start:=time.Now()sum:=0forj:=0;j单个goroutine耗时251.690788ms,多个goroutine耗时254.067156ms单个goroutine应该运行得更快,因为单个goroutine不需要更改上

debugging - 在不修改源代码的情况下调用 runtime.GC()/memprofile

我有一个编译好的Go程序,有时会占用大量内存。不幸的是,我没有它的源代码,所以不可能修改它来添加一个runtime/pprof服务器。我想知道有没有什么方法可以在不修改源代码的情况下调用runtime.GC()或生成堆转储? 最佳答案 我不这么认为。即使对信号(如SIGQUIT)使用react也需要对其进行编码,如seenhere.只有可执行文件(没有.a,没有源代码),你会onlyhavegotoolobjdump. 关于debugging-在不修改源代码的情况下调用runtime.G

go - panic : runtime error: index out of range [recovered]

在将ifj==len(remark)修改为ifj==len(remark)&&z>0之后,我的代码出现了panic错误错误是:---FAIL:TestHey(0.00s)panic:runtimeerror:indexoutofrange[recovered]panic:runtimeerror:indexoutofrangegoroutine5[running]:testing.tRunner.func1(0xc04207a0f0)C:/Go/src/testing/testing.go:711+0x2d9panic(0x526700,0x5f57c0)C:/Go/src/runti

go - panic : runtime error: invalid memory address or nil pointer dereference only on the GAE

我正在使用gin框架开发golang应用程序。基本上它只是以JSON格式从firestore获取数据。在本地它工作得很好,但是当我将它部署到GAE(gcloudappdeploy)时,部署期间没有错误,但是当访问页面时它不起作用,并且在日志中提供了一个错误:“panic:runtimeerror:invalid内存地址或nil指针取消引用”包列表集合import("fmt""log""net/http""cloud.google.com/go/firestore""github.com/gin-gonic/gin""google.golang.org/api/iterator""goo