Skip to content

Commit 5c7bc38

Browse files
proxy lies (#96), #61
1 parent 3499782 commit 5c7bc38

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

js/generic.js

+2
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,8 @@ function showMetrics(type) {
896896
array = gData
897897
} else if (type == "prototype lies") {
898898
array = gLies
899+
} else if (type == "proxy lies") {
900+
array = gLiesProxy
899901
} else if (type == "prototype lies: details") {
900902
array = gLiesDetail
901903
showhash = false

js/globals.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ let jsFiles = [],
1313
gDetail = {},
1414
// prototype lies
1515
gLies = [],
16+
gLiesProxy = [],
1617
gLiesDetail = {},
1718
// known
1819
gKnown = [],

js/prototypeLies.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -706,19 +706,25 @@ function outputPrototypeLies() {
706706
if (iframeContainerDiv) {
707707
iframeContainerDiv.parentNode.removeChild(iframeContainerDiv)
708708
}
709-
let el = dom.prototypehash
710-
let hash = sha1(lieList)
711709
// gRun: snapshot
712710
if (gRun) {
713711
gLies = lieList
712+
gLiesProxy = tamperingList
714713
gLiesDetail = lieDetail
715714
if (lieCount == 0) {
716-
el.innerHTML = "none"
715+
dom.prototypehash = "none"
717716
} else {
718717
let lieString = lieList.length +" lie"+ (lieList.length > 1 ? "s" : "")
719-
hash += buildButton("0", "prototype lies", lieString, "showMetrics")
720-
hash += buildButton("0", "prototype lies: details", "details", "showMetrics")
721-
el.innerHTML = hash
718+
dom.prototypehash.innerHTML = sha1(lieList.join())
719+
+ buildButton("0", "prototype lies", lieString, "showMetrics")
720+
+ buildButton("0", "prototype lies: details", "details", "showMetrics")
721+
}
722+
if (tamperingList.length == 0) {
723+
dom.proxyhash = "none"
724+
} else {
725+
let proxyString = tamperingList.length +" lie"+ (tamperingList.length > 1 ? "s" : "")
726+
dom.proxyhash.innerHTML = sha1(lieList)
727+
+ buildButton("0", "proxy lies", proxyString, "showMetrics")
722728
}
723729
log_perf("prototype lies [prereq]",t0)
724730
}

tzp.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ <h1 class="testRect" id="rect0">https://browserleaks.com<i>/rects</i></h1>
9898
<span class="c mono" id="allcheck"></span></div>
9999
&nbsp loose</td><td class="c mono" id="allhash"></td></tr>
100100
<tr><td>prototype lies <sup>1</sup></td><td class="c mono" id="prototypehash"></td></tr>
101+
<tr><td>proxy lies <sup>1</sup></td><td class="c mono" id="proxyhash"></td></tr>
101102
<tr><td>known lies</td><td class="c mono" id="knownhash"></td></tr>
102103
<tr><td>methods</td><td class="c mono" id="knownmethods"></td></tr>
103-
<tr><td colspan="2"><span class="no_color">prototype lies code provided by </span>
104+
<tr><td colspan="2"><span class="no_color">prototype/proxy lies code provided by </span>
104105
<a target="_blank" class="blue" href="https://github.com/abrahamjuliot/creepjs">CreepJS</a> <sup>1</sup></td></tr>
105106
</table>
106107

0 commit comments

Comments
 (0)