我正在尝试为退出网站创建版本。 我已按照git repo提供的说明进行操作 browser-usage
但是当我尝试启动构建文件时,它给出错误消息为
请查看html文件代码:
<script src="polyfill.js"></script>
<script src="mattermost.client4.js"></script>
<script src="mattermost.websocket.js"></script>
<script type="text/javascript">
const client = Mattermost.client4.default();
const wsClient = Mattermost.websocket.default;
var token;
client.setUrl('https://your-mattermost-url.com');
/* use an existing personal access token */
client.setToken('yourToken');
client.setIncludeCookies(false);
/* login and obtain a token */
client.login(username, password)
.then(function(user){
console.log(`Logged in as ${user.email}`);
token = client.getToken();
})
.then(function(){
wsClient.initialize(token, {}, {}, {connectionUrl: 'wss://your-mattermost-url.com/api/v4/websocket'});
})
.catch(function(err){
console.error(err);
});
</script>