logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

electron 打开 webview 的 devtools openDevTools

项目场景:electron项目的webview需要注入preload js,但是我发现注入的preload js似乎没有正常执行。随即想打开webview网页的devtools看看。代码如下问题描述:index.html<webview id="link-view" src="https://v.qq.com/x/page/m3206njx773.html" allowpopups prel

#javascript#electron#webview
nodejs 爬虫中文字体乱码 superagent iconvLite

nodejs 对于编码格式为 gb2313的网页无法正确解析,有两个解决办法,欢迎补充。1 使用 superagent-charset 插件其实 superagent-charset插件也用到了iconvLiteconst superagent = require('superagent');const charset = require('superagent-charset');charset

#node.js
puppeteer 清空input原本的值

项目场景:puppeteer 中 使用 page 输入 input 的时候,有可能需要清除 input 原本就有的值。解决方案:方案1在浏览器环境中,使用 jquery 或者 js 直接清空 input 的值await page.evaluate( () => document.getElementById("inputID").value = "")请注意 这种方案只是给input的值清空

#javascript
js代码 RGBA颜色格式转换为16进制格式 javascript

function hexify(color) {var values = color.replace(/rgba?\(/, '').replace(/\)/, '').replace(/[\s+]/g, '').split(',');var a = parseFloat(values[3] || 1),r = Math.floor(a * parseInt(values[0]) + (1 - a)

#javascript
nodejs 爬虫中文字体乱码 superagent iconvLite

nodejs 对于编码格式为 gb2313的网页无法正确解析,有两个解决办法,欢迎补充。1 使用 superagent-charset 插件其实 superagent-charset插件也用到了iconvLiteconst superagent = require('superagent');const charset = require('superagent-charset');charset

#node.js
chrome扩展(插件)开发(四)content_script,background,popup,injected-script之间的消息通信通知以及数据传递

chrome 插件之消息通知 自有api和sessionStorage还有自定义事件chrome扩展之加载外部js到原网页中 1使用jquery的loadJs()2 使用chrome.extension.getURL

#javascript#vue.js#html5 +1
chrome扩展(插件)开发(三)被content_script注入的js使用和限制

chrome 插件之消息通知 自有api和sessionStorage还有自定义事件chrome扩展之加载外部js到原网页中 1使用jquery的loadJs()2 使用chrome.extension.getURL

#chrome#chrome devtools#javascript +1
chrome扩展(插件)开发(三)被content_script注入的js使用和限制

chrome 插件之消息通知 自有api和sessionStorage还有自定义事件chrome扩展之加载外部js到原网页中 1使用jquery的loadJs()2 使用chrome.extension.getURL

#chrome#chrome devtools#javascript +1
外部 js 调用vue里面的方法或者变量

vue 方法mounted () {window.testFun = this.testFun;// 方法赋值给window},methods: {// vue内部方法testFun () {},}外部js调用<script>function test() {testFun();// 直接通过window方法去调用methods中对应方法}</script>...

#vue.js#html5#javascript
chrome扩展(插件)开发(五)监听网页的ajax请求

1 chrome 自有api2; (function () {function ajaxEventTrigger(event) {var ajaxEvent = new CustomEvent(event, { detail: this });window.dispatchEvent(ajaxEvent);}var oldXHR = window.XMLHttpRequest;function n

#javascript
到底了