JavaScript

monaco-editor实现语法高亮

monaco editor如果想做语法高亮的话,需要配置language,这里介绍下相关操作。

11月 7, 2024

Monaco-Editor Implementation of Syntax Highlighting

You need to configure the language to implement syntax highlighting in Monaco Editor. Here, we introduce the related operations. Set Language If setting the language during initialization, the operation is as follows:

11月 7, 2024

快速修复开源社区repo的bug

项目中经常会使用很多第三方的NPM包,比如Mousetrap,很多时候会遇到bug,但是官方的bug还没修复或者还没合并发包,那么这个时候怎么办呢。这里总结下方法。

10月 24, 2024

Quickly Fix Bugs in Open Source Community Repositories

In projects, we often use many third-party NPM packages, such as Mousetrap. We usually encounter bugs that have not yet been fixed or merged by the official repository. So, what should we do in such cases? Here is a summary of the methods.

10月 24, 2024

浏览器指纹

WEB如果提供了账户登录,我们自然可以区分。如果是匿名用户我们如何区分呢,这时就需要浏览器指纹了。浏览器指纹是浏览器在特定时间点上,由用户设备上所有可用的信息生成的唯一标识符。浏览器JS本身是无法直接提供指纹的,需要自行实现,当然社区已有成熟的类库,比如 fingerprintjs。

10月 22, 2024

Browser Fingerprinting

What browser fingerprints are, FingerprintJS v3 vs. v4 licensing, expected accuracy, and basic usage.

10月 22, 2024

了解ua-parser-js

实际开发中经常解析UA头部来判断用户设备信息,比如判断是Win还是Mac,或者判断是不是移动设备等等。我们直接用userAgent的话就自己手动解析该字符串,并不是很方便。比较简单的办法是引入ua-parser-js,这是一个成熟的类库,有了它就可以方便的获取ua中携带的信息了。

10月 18, 2024

Understanding ua-parser-js

In real-world development we often parse the UA header to detect device details—whether the user is on Windows or macOS, or if they’re on mobile. If you just use userAgent, you have to parse the string by hand, which is painful. A much easier option is to bring in ua-parser-js, a mature library that surfaces the UA information for you.

10月 18, 2024

前端可视化图编辑技术

最近项目需要提供用户有个可视化设计流程处理的feat,因此需要实现下可视化。这里调研总结下市面上的一些方案。

10月 17, 2024

Frontend Visual Graph Editing

A recent project needed a visual flow editor. Here’s a survey of available libraries and tools. IBM’s Open-Source Node-RED Apache License Graph Layout Library dagre-d3 MIT License Graph Layout Library cola.js MIT License

10月 17, 2024