Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@tiaod/weapp-polyfill
Advanced tools
Polyfills for w3c API on top of Weapp API, including:
微信小程序设计了一系列 IO 相关的 API,但社区中现存的模块绝大部分使用的是 w3c 标准的 API。本项目通过 polyfill 这些 w3c API 允许开发者在不修改第三方模块代码的情况下直接在小程序中使用这些模块。
npm i weapp-polyfill -D
如果你的应用或 SDK 使用打包工具(打包成一个文件后再导入微信开发工具使用),你可以在程序入口的最开始 auto polyfill 所有 API
require('weapp-polyfill/auto-polyfill');
即可在整个项目中直接使用浏览器 API。See a realworld demo。
weapp-polyfill pacakge 本身 export 了以下对象:
const {
XMLHttpRequest,·
FormData,
WebSocket,
localStorage,
polyfill,
} = requrie('weapp-polyfill');
不支持不使用打包工具直接在微信开发工具使用。
由于微信 API 的限制,polyfill 的 API 有以下限制:
getResponseHeade('content-type')
始终返回 'application/json'
,其他 key 始终返回 ''
HEADERS_RECEIVED
与 LOADING
状态uri
属性的对象,uri
的值为通过微信 API 得到的本地临时文件路径:{ uri: 'tempFilePath' }
FAQs
Browser API polyfill for Weapp
The npm package @tiaod/weapp-polyfill receives a total of 8 weekly downloads. As such, @tiaod/weapp-polyfill popularity was classified as not popular.
We found that @tiaod/weapp-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.