草庐IT

chrome76

全部标签

javascript - innerHTML 适用于 IE 和 Firefox,但不适用于 Chrome

数据不会显示在Chrome中,除非我在Chrome中打开IE选项卡转到该站点然后将其关闭返回到Chrome(抱歉,如果这没有多大意义)。window.onload=function(){varurl="http://----.freeiz.com/gbSales/sales.json";varrequest=newXMLHttpRequest();request.open("GET",url);request.onload=function(){if(request.status==200){updateSales(request.responseText);}};request.se

javascript - window.open 在 chrome 扩展中返回 undefined

我有基于内容脚本的Chrome扩展程序。我通过内容脚本中的弹出窗口启动登录过程。我使用下面的代码打开一个弹出窗口,然后等到它关闭。但是,我从window.open方法中得到一个“undefined”。有人知道为什么会这样吗?loginwin在下面的代码中是undefined尽管弹出窗口可以正常打开指定的login_url。下面的代码是从我的内容脚本中调用的。varloginWin=window.open(login_url,'LoginWindow',"width=655,height=490");console.log(loginWin);//Checkevery100msifthe

javascript - 从 chrome 或 firefox 中的调试控制台在 .js 文件上运行 JSLint

是否可以在一个或多个.js文件上运行JSLint,方法是在chrome或firefox中从调试/开发人员控制台随后将JSLint加载到header中?我想这样做的原因是我想在console.log()中打印JSON中JSLint的解析,它在文档中说://YoucanobtaintheparsetreethatJSLintconstructedwhileparsing.The//latesttreeiskeptinJSLINT.tree.Anicestringicationcanbeproduced//with//JSON.stringify(JSLINT.tree,[//'string

javascript - 为什么 document.execCommand ("copy") 在我的 chrome 扩展程序的内容脚本中不起作用?

这个问题在这里已经有了答案:Whyisdocument.execCommand("paste")notworkinginGoogleChrome?(8个答案)关闭8年前。我想从我正在创建的chrome扩展中将一些数据写入剪贴板。在list文件中,我授予了clipboardRead和clipboardWrite权限。我使用我发现的这个函数here但它不起作用。似乎是“document.execCommand('copy');”不能工作。我在内容脚本中编写了所有这些代码。谢谢list:{"manifest_version":2,"name":"easyCopy","description"

javascript - 如何在 Chrome 中以编程方式切换 Zurb Foundation 开关控件?

我想使用javascript动态切换ZurbFoundationSwitch控件的状态。这是默认的ZurbFondation开关:OffOn演示here.它们基于thisproject,我相信。当我尝试使用jquery更改开关的状态时:$('#d1').attr('checked','checked');$('#d').removeAttr('checked');//SwitchON$('#d').attr('checked','checked');$('#d1').removeAttr('checked');//SwitchOFF它在Firefox中有效,但在Chrome中无效。在C

javascript - 从 Chrome 扩展访问 iframe URL

我有一个扩展需要加载一个页面,该页面在其背景页面中有很多重定向。一旦该页面到达已知URL(https://website.com/index.php),iframe应将其src设置为about:blank。最终页面非常大,有大图片和所有不需要加载的东西,所以我没有附加到iframe的onload事件,而是将以下函数设置为100毫秒的时间间隔:functionupdate(){if(document.getElementsByTagName('iframe')[0].contentDocument.location.href=="https://website.com/index.php

javascript - Chrome 网上商店服务器拒绝带有 "Error : The manifest must define a version."的扩展

注意:这个问题是关于您在进行Chrome开发时使用的manifest.json的version属性。它看起来与下面关于manifest_version的问题类似,但事实并非如此。我真的很想从中吸取教训,但我失败了。NeedtoupdateChromeextensiontomanifestversion2ifnomanifestversionoriginallyspecified?--我目前正在做我的第一个Chrome扩展。强大、有趣、棒极了。除了一件让我烦恼的蠢事。我的Chrome扩展程序是开源的,所以你可以直接转到GitHub上的代码,这样你就可以立即看到我犯了一个愚蠢的错误http

javascript - 仅在 Chrome 中格式错误的 RTCConfiguration

我正在使用WebRTC,但发现并非所有浏览器都支持它。但是,Chrome和Firefox确实支持它(在较新的版本中;我安装了最新版本),只要您具有某些变量的正确前缀即可。例如,我有以下用于PeerConnection的跨浏览器支持:varPeerConnection=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection;现在应该是支持跨浏览器了,我有如下代码:varservers={iceservers:[{url:"stun:23.21.150.121"},{url:

javascript - 是否有 FF 等同于 chrome.declarativeContent.onPageChanged?

我正在将Chrome扩展程序移植到FirefoxWebExtensions,我一直在寻找chrome.declarativeContent.onPageChanged的解决方法。我的FFWebextension包含一个在某些网站上导航时必须显示的页面操作。但是,可用API中的所有监听器似乎都不允许这样做。特别是我试过:chrome.runtime.onInstalled.addListener(onChange);chrome.tabs.onCreated.addListener(onChange);chrome.tabs.onActivated.addListener(onChang

javascript - 在页面加载时在 chrome 扩展中运行 js 脚本

我需要构建一个操作dom的chrome扩展我正在学习一些教程,现在我有这个manifest.json:{"manifest_version":2,"name":"Gettingstartedexample","description":"ThisextensionshowsaGoogleImagesearchresultforthecurrentpage","version":"1.0","browser_action":{"default_icon":"icon.png","default_popup":"popup.html"},"permissions":["activeTab"