我一直在使用 HTML Javascript,我正在通過節點使用 Live 服務器,這就是我在控制臺上得到的。

以防萬一您想查看我的 HTML 和 JS 代碼。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Developer Skills & Editor Setup</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}
h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
</head>
<body>
<h1>Developer Skills & Editor Setup???♀?</h1>
<script src="script.js"></script>
</body>
</html>
這是我的 JS。
'use strict';
console.log('Hello World');
這是第一個錯誤
xx.js:1 Uncaught ReferenceError: AbstractProvider is not defined
at xx.js:1
(anonymous) @ xx.js:1
const XXProvider=class extends AbstractProvider{search(){$("video").not("." INIT_CLASS).each((a,b)=>{const c=$(b),d=b.src;if(!d)return c.addClass(INIT_CLASS),console.warn("empty src!",b);const e=new URL(d),f=/.mp4$/.test(e.pathname);return f?void(!this.ids[d]&&this.addVideo(d,c.parent()),c.addClass(INIT_CLASS)):(c.addClass(INIT_CLASS),console.warn("not mp4!",b))})}getVideoData(a,b){const c=Date.now().toString();b({vid:a,title:c,provider:"xx",variants:[{url:a,quality:"720"}]})}};
這是第二個錯誤
class Content{constructor(){this.pr=null,this.initProvider(),this.initRuntimeListener()}initProvider(){location.href.includes("facebook.com")?this.pr=new FBProvider:location.href.includes("vk.com")?this.pr=new VKProvider:location.href.includes("vimeo.com")?this.pr=new VMProvider:location.href.includes("dailymotion.com")?this.pr=new DMProvider:location.href.includes("instagram.com")?this.pr=new INProvider:location.href.includes("twitter.com")?this.pr=new TWProvider:location.href.includes("youtube.com")?(this.pr=null,chrome.runtime.sendMessage({action:"setBadgeDisabled"})):this.pr=new XXProvider,this.pr&&this.pr.run()}initRuntimeListener(){chrome.runtime.onMessage.addListener((a,b,c)=>{"getVideo"===a.action&&this.pr&&c(this.pr.videos)})}}let downloadQuery=new URL(window.location.href).searchParams.get("isdowloadquery");window.self!==window.top||downloadQuery||(window.onload=function(){new Content});
uj5u.com熱心網友回復:
我正在做一個在 laravel 中的專案。我遇到了同樣的錯誤,但是當我將滑鼠懸停在錯誤上時,我看到它說 chrome 擴展。所以我禁用了擴展。此外,當我在隱身選項卡中打開網站鏈接時,它正在作業,隱身沒有錯誤,但在其他視窗中,出現錯誤,這是因為 chrome 擴展。嘗試將所有站點的所有擴展程式的訪問權限更改為單擊擴展程式時。
uj5u.com熱心網友回復:
您沒有給“AbstractProvider”變數任何值。請在您的問題中分享完整的 javascript 代碼,否則將很難回答。根據您在問題中提供的代碼,不應該有這樣的問題。
嘗試:在 body 元素之外添加 < script > 標簽(在它下面)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/422442.html
標籤:
