這個是在js逆向中使用jsdom模擬瀏覽器環(huán)境,結果還是報錯了:?
網(wǎng)上很多說法是安裝canvas: npm install canvas,其實并不正確?
解決辦法:加入以下代碼:
window.HTMLCanvasElement.prototype.getContext = () => {
? // return whatever getContext has to return
};
問題解決:
文章來源:http://www.zghlxwxcb.cn/news/detail-829973.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-829973.html
到了這里,關于解決報錯:Not implemented: HTMLCanvasElement.prototype.getContext (xxx installing the canvas npm pack的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!