-
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.
Shim internet access out of extensions on extension host and in web v…
…iew (#93)
- Loading branch information
Showing
23 changed files
with
430 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16.17.1 | ||
18.0.0 |
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
"endregion", | ||
"guids", | ||
"Hopkinson", | ||
"iframes", | ||
"localstorage", | ||
"maximizable", | ||
"nums", | ||
|
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,49 @@ | ||
/* eslint-disable global-require */ | ||
|
||
'use strict'; | ||
|
||
// eslint-disable-next-line import/no-unresolved | ||
const papi = require('papi'); | ||
|
||
const { logger } = papi; | ||
|
||
logger.log('Evil is importing! Mwahahaha'); | ||
|
||
try { | ||
// This will be blocked | ||
const fs = require('fs'); | ||
logger.log(`Successfully imported fs! fs.readFileSync = ${fs.readFileSync}`); | ||
} catch (e) { | ||
logger.log(e.message); | ||
} | ||
|
||
try { | ||
// This will be blocked and will suggest the papi.fetch api | ||
const https = require('https'); | ||
logger.log(`Successfully imported https! ${https}`); | ||
} catch (e) { | ||
logger.log(e.message); | ||
} | ||
|
||
try { | ||
// This is just for testing and will throw an exception | ||
fetch('test'); | ||
} catch (e) { | ||
logger.log(`Evil: Error on fetch! ${e}`); | ||
} | ||
|
||
try { | ||
// This is just for testing and will throw an exception | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const xhr = new XMLHttpRequest(); | ||
} catch (e) { | ||
logger.log(`Evil: Error on XMLHttpRequest! ${e}`); | ||
} | ||
|
||
try { | ||
// This is just for testing and will throw an exception | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const webSocket = new WebSocket(); | ||
} catch (e) { | ||
logger.log(`Evil: Error on WebSocket! ${e}`); | ||
} |
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,10 @@ | ||
{ | ||
"name": "evil", | ||
"version": "0.0.1", | ||
"description": "Paranext extension that tries to break things!!1!!", | ||
"author": "TJ Couch", | ||
"license": "MIT", | ||
"main": "evil.js", | ||
"activationEvents": [ | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"name": "evil", | ||
"version": "0.0.1", | ||
"description": "Paranext extension that tries to break things!!1!!", | ||
"main": "evil.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "TJ Couch", | ||
"license": "MIT" | ||
} |
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
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
Oops, something went wrong.