This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
forked from replit/replit-vscode
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from RoBlockHead/multiplayer
Version 0.9.0! We're finally here!
- Loading branch information
Showing
7 changed files
with
196 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* eslint-disable max-len */ | ||
import * as vscode from 'vscode'; | ||
|
||
export const renderCaptchaRefresh = async (context: vscode.ExtensionContext): Promise<boolean|void> => { | ||
const captchaWebview = vscode.window.createWebviewPanel( | ||
'captchaWebview', | ||
'Replit CAPTCHA Refresh', | ||
vscode.ViewColumn.One, | ||
{ | ||
enableScripts: true, | ||
}, | ||
); | ||
captchaWebview.webview.onDidReceiveMessage((message) => { | ||
context.secrets.store('captchaKey', message); | ||
captchaWebview.dispose(); | ||
return true; | ||
}); | ||
captchaWebview.webview.html = ` | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' ${captchaWebview.webview.cspSource} https:;"> | ||
<style> | ||
body { | ||
margin: 0; | ||
border: 0; | ||
width: 100% | ||
} | ||
iframe { | ||
margin: 0; | ||
border: 0; | ||
width: 100% | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Refresh your Replit CAPTCHA verification</h1> | ||
<h3>Click the box below to refresh your human verification. This window will close when you've completed the verification.</h3> | ||
<iframe src="https://vsc-captcha.vscode.repl.co"></iframe> | ||
<script> | ||
const vscode = acquireVsCodeApi(); | ||
console.log(window); | ||
function handleMessage(message){ | ||
vscode.postMessage(message.data); | ||
} | ||
window.addEventListener('message', handleMessage, false); | ||
</script> | ||
</body> | ||
</html> | ||
`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.