-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows Browser: Script Injection test pages (#185)
* First pass at getting script injection test pages into Privacy Test Pages * Refactored tests for better naming * Update windows-browser/script-injection/secureWorld_index.html Co-authored-by: Maxim Tsoy <[email protected]> --------- Co-authored-by: Maxim Tsoy <[email protected]>
- Loading branch information
1 parent
d0b96a8
commit 581c6a2
Showing
5 changed files
with
376 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Windows Browser: Main World Content Scope script tests</title> | ||
|
||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
table { | ||
border-collapse: separate; | ||
border-spacing: 0; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
width: 50%; | ||
box-shadow: 0 5px 15px rgba(0,0,0,0.1); | ||
} | ||
|
||
th, td { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
text-align: left; | ||
} | ||
|
||
th { | ||
background-color: #4CAF50; | ||
color: white; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: #f2f2f2; | ||
} | ||
|
||
tr:hover { | ||
background-color: #ddd; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<p><a href="../../index.html">[Home]</a></p> | ||
<h2>Windows Browser: Main World Content Scope script tests</h2> | ||
|
||
<p>Validates the Windows Browser can successfully inject MainWorld scripts and provides message dispatching.</P> | ||
|
||
|
||
<table> | ||
<tr> | ||
<td>Content scripts executed:</td> | ||
<td id="mainWorld-testResult-1">False</td> | ||
</tr> | ||
<tr> | ||
<td>Message to handlers:</td> | ||
<td id="mainWorld-testResult-3">False</td> | ||
</tr> | ||
<tr> | ||
<td>Round trip message from JS back to JS:</td> | ||
<td id="mainWorld-testResult-4">False</td> | ||
</tr> | ||
<tr> | ||
<td>ExecutableScript updated:</td> | ||
<td id="mainWorld-testResult-5">False</td> | ||
</tr> | ||
<tr> | ||
<td>Value set by script not visible to page:</td> | ||
<td id="mainWorld-testResult-6">True</td> | ||
</tr> | ||
</table> | ||
<h2>Iframe (same origin):</h2> | ||
<iframe src="mainWorld_iframe.html" height="400"></iframe> | ||
|
||
<h2>Iframe (different origin):</h2> | ||
<iframe src="https://good.third-party.site/windows-browser/script-injection/mainWorld_iframe.html" height="400"></iframe> | ||
<script> | ||
if (typeof window.helloFromDDG !== 'undefined') { | ||
document.getElementById("mainWorld-testResult-6").innerHTML = "False"; | ||
} | ||
</script> | ||
<a href="./index.html">Main World Content Scope script tests</a> | ||
<a href="./secureWorld_index.html">Secure World Content Scope script tests</a> | ||
|
||
<form action="./index.html" method="POST" target="_blank"> | ||
<!-- Add any form elements here if needed --> | ||
<button type="submit">Main World Content Scope script tests with POST to _blank</button> | ||
</form> | ||
|
||
|
||
<form action="./secureWorld_index.html" method="POST" target="_blank"> | ||
<!-- Add any form elements here if needed --> | ||
<button type="submit">Secure World Content Scope script tests with POST to _blank</button> | ||
</form> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
table { | ||
border-collapse: separate; | ||
border-spacing: 0; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
width: 50%; | ||
box-shadow: 0 5px 15px rgba(0,0,0,0.1); | ||
} | ||
|
||
th, td { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
text-align: left; | ||
} | ||
|
||
th { | ||
background-color: #4CAF50; | ||
color: white; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: #f2f2f2; | ||
} | ||
|
||
tr:hover { | ||
background-color: #ddd; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2>Main world tests</h2> | ||
<table> | ||
<tr> | ||
<td>Content scripts executed:</td> | ||
<td id="mainWorld-testResult-1">False</td> | ||
</tr> | ||
<tr> | ||
<td>Message to handlers:</td> | ||
<td id="mainWorld-testResult-3">False</td> | ||
</tr> | ||
<tr> | ||
<td>Round trip message from JS back to JS:</td> | ||
<td id="mainWorld-testResult-4">False</td> | ||
</tr> | ||
<tr> | ||
<td>ExecutableScript updated:</td> | ||
<td id="mainWorld-testResult-5">False</td> | ||
</tr> | ||
<tr> | ||
<td>Value set by script not visible to page:</td> | ||
<td id="mainWorld-testResult-6">True</td> | ||
</tr> | ||
</table> | ||
<script> | ||
if (typeof window.helloFromDDG !== 'undefined') { | ||
document.getElementById("mainWorld-testResult-6").innerHTML = "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
table { | ||
border-collapse: separate; | ||
border-spacing: 0; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
width: 50%; | ||
box-shadow: 0 5px 15px rgba(0,0,0,0.1); | ||
} | ||
|
||
th, td { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
text-align: left; | ||
} | ||
|
||
th { | ||
background-color: #4CAF50; | ||
color: white; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: #f2f2f2; | ||
} | ||
|
||
tr:hover { | ||
background-color: #ddd; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2>Main world tests</h2> | ||
<table> | ||
<tr> | ||
<td>Content scripts executed:</td> | ||
<td id="secureWorld-testResult-1">False</td> | ||
</tr> | ||
<tr> | ||
<td>Message to handlers:</td> | ||
<td id="secureWorld-testResult-3">False</td> | ||
</tr> | ||
<tr> | ||
<td>Round trip message from JS back to JS:</td> | ||
<td id="secureWorld-testResult-4">False</td> | ||
</tr> | ||
<tr> | ||
<td>ExecutableScript updated:</td> | ||
<td id="secureWorld-testResult-5">False</td> | ||
</tr> | ||
<tr> | ||
<td>Value set by script not visible to page:</td> | ||
<td id="secureWorld-testResult-6">True</td> | ||
</tr> | ||
</table> | ||
<script> | ||
if (typeof window.helloFromSecureDDG !== 'undefined') { | ||
document.getElementById("secureWorld-testResult-6").innerHTML = "False"; | ||
} | ||
</script> | ||
</body> | ||
</html> |
106 changes: 106 additions & 0 deletions
106
windows-browser/script-injection/secureWorld_index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Windows Browser: Secure World Content Scope script tests</title> | ||
|
||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
table { | ||
border-collapse: separate; | ||
border-spacing: 0; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
width: 50%; | ||
box-shadow: 0 5px 15px rgba(0,0,0,0.1); | ||
} | ||
|
||
th, td { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
text-align: left; | ||
} | ||
|
||
th { | ||
background-color: #4CAF50; | ||
color: white; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: #f2f2f2; | ||
} | ||
|
||
tr:hover { | ||
background-color: #ddd; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<p><a href="../../index.html">[Home]</a></p> | ||
<h2>Windows Browser: Secure World Content Scope script tests</h2> | ||
|
||
<p>Validates the Windows Browser can successfully inject SecureWorld scripts and provides message dispatching.</P> | ||
<table> | ||
<tr> | ||
<td>Content scripts executed:</td> | ||
<td id="secureWorld-testResult-1">False</td> | ||
</tr> | ||
<tr> | ||
<td>Message to handlers:</td> | ||
<td id="secureWorld-testResult-3">False</td> | ||
</tr> | ||
<tr> | ||
<td>Round trip message from JS back to JS:</td> | ||
<td id="secureWorld-testResult-4">False</td> | ||
</tr> | ||
<tr> | ||
<td>ExecutableScript updated:</td> | ||
<td id="secureWorld-testResult-5">False</td> | ||
</tr> | ||
<tr> | ||
<td>Value set by script not visible to page:</td> | ||
<td id="secureWorld-testResult-6">True</td> | ||
</tr> | ||
</table> | ||
<h2>Iframe (same origin):</h2> | ||
<iframe src="secureWorld_iframe.html" height="400"></iframe> | ||
|
||
<h2>Iframe (different origin):</h2> | ||
<iframe src="https://good.third-party.site/windows-browser/script-injection/secureWorld_iframe.html" height="400"></iframe> | ||
<script> | ||
if (typeof window.helloFromSecureDDG !== 'undefined') { | ||
document.getElementById("secureWorld-testResult-6").innerHTML = "False"; | ||
} | ||
</script> | ||
<a href="./index.html">Main World Content Scope script tests</a> | ||
<a href="./secureWorld_index.html">Secure World Content Scope script tests</a> | ||
|
||
<form action="./index.html" method="POST" target="_blank"> | ||
<!-- Add any form elements here if needed --> | ||
<button type="submit">Main World Content Scope script tests with POST to _blank</button> | ||
</form> | ||
|
||
|
||
<form action="./secureWorld_index.html" method="POST" target="_blank"> | ||
<!-- Add any form elements here if needed --> | ||
<button type="submit">Secure World Content Scope script tests with POST to _blank</button> | ||
</form> | ||
</body> | ||
</html> |