This repository has been archived by the owner on May 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
052e635
commit 8dd5b39
Showing
16 changed files
with
1,524 additions
and
28 deletions.
There are no files selected for viewing
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
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,21 @@ | ||
import { RammerheadAPI, StrShuffler } from './rhAPI.js'; | ||
|
||
async function startRH(){ | ||
let api = new RammerheadAPI('http://localhost:3000'); | ||
await fetch('http://localhost:3000'); | ||
if ( localStorage.getItem('rammerhead_session') && (await api.sessionExists(localStorage.getItem('rammerhead_session'))) ) { | ||
const test = await fetch( new URL(localStorage.getItem('rammerhead_session'), 'http://localhost:3000') ); | ||
await api.deleteSession(localStorage.getItem('rammerhead_session')); | ||
// 404 = good, 403 = Sessions must come from the same IP | ||
if (test.status === 403) localStorage.removeItem('rammerhead_session'); | ||
} else { | ||
localStorage.removeItem('rammerhead_session'); | ||
} | ||
let session = (async api.newSession()); | ||
localStorage.setItem('rammerhead_session', session) | ||
await api.editSession(session, false, true); | ||
const dict = await api.shuffleDict(session); | ||
const shuffler = new StrShuffler(dict); | ||
location.replace(new URL(`${session}/${shuffler.shuffle('https://google.com')}`, 'http://localhost:3000')); | ||
} | ||
window.onload = startRH() |
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,2 @@ | ||
import { rhFunc } from './rhHelper.js'; | ||
window.rh = rhFunc |
Oops, something went wrong.