Skip to content

Commit

Permalink
lotsa stuff (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorin-Oakenpants authored Oct 13, 2023
1 parent 0e7c40f commit 58e642d
Show file tree
Hide file tree
Showing 16 changed files with 947 additions and 928 deletions.
8 changes: 4 additions & 4 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ code {
background: rgba(142, 142, 145, 0.25) !important;
padding: 2px 6px; /* top+bottom | left+ right */
}
code.lies {
background-color: rgba(255, 79, 79, 0.6) !important;
color: white;
}

#modaloverlay {
position: fixed;
Expand Down Expand Up @@ -122,6 +118,10 @@ a.return {color: var(--test12); text-decoration: none; font-size: 14px; line-he
.strike {text-decoration: line-through;}
.spaces {white-space: pre-wrap;}
.perf {font-family: monospace, "Courier New"; font-size: 12px; white-space: pre-wrap;}
.lies {
color: var(--test99);
text-decoration: underline; /*var(--test0);*/
}

.cursive {font-family: cursive;}
.emoji {font-family: emoji;}
Expand Down
6 changes: 5 additions & 1 deletion css/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
@media (color:18){#cssC:after{content:"18";}}
@media (color:19){#cssC:after{content:"19";}}
@media (color:20){#cssC:after{content:"20";}}
@media (color:21){#cssC:after{content:"";}}
@media (color:21){#cssC:after{content:"21";}}
@media (color:22){#cssC:after{content:"22";}}
@media (color:23){#cssC:after{content:"23";}}
@media (color:24){#cssC:after{content:"24";}}
@media (color:25){#cssC:after{content:"";}}

#cssP:after{content:"n/a";}
@media (pointer:fine){#cssP:after{content:"fine";}}
Expand Down
2 changes: 1 addition & 1 deletion js/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const get_audio2_context = (os = isOS) => new Promise(resolve => {

// ac-outputLatency is variable per tab and even on page load
// so on non RFP hashes, change it to variable and display the original on screen
if (note !== rfp_green) {
if (isGecko && note !== rfp_green) {
latencynote = " [" + objnew["ac-outputLatency"]+ " latency]"
objnew["ac-outputLatency"] = "variable"
hash = mini(objnew)
Expand Down
54 changes: 32 additions & 22 deletions js/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ function get_colors() {
'InfoText','Menu','MenuText','Scrollbar','ThreeDDarkShadow','ThreeDFace','ThreeDHighlight',
'ThreeDLightShadow','ThreeDShadow','Window','WindowFrame','WindowText',
],
"moz": [ // FF117+:
"moz": [ // FF120+:
'-moz-buttonhoverface','-moz-buttonhovertext','-moz-cellhighlight','-moz-cellhighlighttext',
'-moz-combobox','-moz-comboboxtext','-moz-dialog','-moz-dialogtext','-moz-eventreerow','-moz-field',
'-moz-fieldtext','-moz-html-cellhighlight','-moz-html-cellhighlighttext','-moz-mac-active-menuitem',
'-moz-mac-active-source-list-selection','-moz-mac-defaultbuttontext','-moz-mac-disabledtoolbartext',
'-moz-mac-focusring','-moz-mac-menuitem','-moz-mac-menupopup','-moz-mac-menutextdisable',
'-moz-mac-menutextselect','-moz-mac-source-list','-moz-mac-source-list-selection','-moz-mac-tooltip',
'-moz-menubarhovertext','-moz-menuhover','-moz-menuhovertext','-moz-nativehyperlinktext','-moz-oddtreerow',
'-moz-mac-focusring','-moz-mac-menuitem','-moz-mac-menupopup','-moz-mac-source-list',
'-moz-mac-source-list-selection','-moz-mac-tooltip','-moz-menubarhovertext','-moz-menuhover',
'-moz-menuhovertext','-moz-nativehyperlinktext','-moz-oddtreerow',
],
}

if (isVer < 117) {
if (isVer < 120) { // ToDo: change to < 119 once beta backport confirmed
let aTmp = oList["moz"]
aTmp.push (
// removed/backported FF119 1857695
'-moz-mac-menutextdisable','-moz-mac-menutextselect',
// removed FF117
"-moz-buttondefault","-moz-dragtargetzone","-moz-mac-chrome-active","-moz-mac-chrome-inactive",
"-moz-mac-menuselect","-moz-mac-menushadow","-moz-mac-secondaryhighlight","-moz-menubartext",
Expand Down Expand Up @@ -85,9 +87,10 @@ function get_colors() {
let btn = addButton(14, METRIC, Object.keys(newobj).length +"/"+ count)
addData(14, METRIC, newobj, hash)
if (isSmart && type == "moz") {
let check = "5a00aa84" // FF117+
if (isVer < 103) {check = "c0df6598"} else if (isVer < 117) {check = "788e7d22"}
notation = hash == check ? rfp_green : rfp_red // 1734115
let check = "47538602" // FF119+
if (isVer < 117) {check = "788e7d22" // 115-116
} else if (isVer < 119) {check = "5a00aa84"} // 117-118
notation = hash == check ? rfp_green : rfp_red
}
log_display(14, METRIC, hash + btn + notation)
} catch(e) {
Expand Down Expand Up @@ -118,7 +121,7 @@ function get_computed_styles() {
const names = ["styles_cssrulelist","styles_getcomputed","styles_htmlelement"]
let aErr = [false, false, false], isLies = false
let aHashes = [], intHashes = [], oDisplay = {}
let check = (isSmart && isTB && isVer > 114)
let check = (isSmart && isTB)
let notation = check ? tb_red : ""

let styleVersion = type => {
Expand Down Expand Up @@ -297,12 +300,17 @@ function get_computed_styles() {
log_known(SECT14, METRIC)
} else {
if (check) {
/* win diff
layout.css.font-variations.enabled = locked false on win 7
fontOpticalSizing, font-optical-sizing, fontVariationSettings, font-variation-settings
*/
if (hash === "e32d06bd") {notation = tb_green // TB/MB win11 + linux, TB android: 1102
} else if (hash === "e14684e7") {notation = tb_green} // TB/MB win7 1098
if (isOS == "mac") {
/* mac 1102 vs win 1102: mac has: MozOsxFontSmoothing, -moz-osx-font-smoothing */
if (hash === "75600d93") {notation = tb_green} // TB 1102
} else {
/* win diff
layout.css.font-variations.enabled = locked false on win 7
fontOpticalSizing, font-optical-sizing, fontVariationSettings, font-variation-settings
*/
if (hash === "e32d06bd") {notation = tb_green // TB/MB win11 + linux, TB android: 1102
} else if (hash === "e14684e7") {notation = tb_green} // TB/MB win7 1098
}
}
addData(14, METRIC, res[lookup]["keys"], hash)
}
Expand Down Expand Up @@ -343,7 +351,7 @@ function get_computed_styles() {

const get_mm_css = () => new Promise(resolve => {
function get_mm(type, id, rfpvalue, minVer) {
const METRIC = type
const METRIC = type, METRIC2 = type +"_css"
let value = zNA, display = value, q = type, isErr = false
try {
if (window.matchMedia("("+ q +":no-preference)").matches) {value = "no-preference"
Expand All @@ -362,24 +370,26 @@ const get_mm_css = () => new Promise(resolve => {
display = log_error(SECT14, METRIC, e)
value = zErr
}
let cssvalue = getElementProp(SECT14, "#css"+ id, METRIC2)
let isErrCss = cssvalue == zErr
if (isSmart) {
let cssvalue = getElementProp(SECT14, "#css"+ id)
if (value !== cssvalue && cssvalue !== "x") {
if (!isErr) {
if (!isErr && !isErrCss) {
if (value !== cssvalue) {
display = colorFn(display)
value = zLIE
log_known(SECT14, METRIC)
}
}
if (rfpvalue !== undefined) {
// notate: only apply notation from when it was flipped
// notate from when it was flipped
if (minVer == undefined || minVer < isVer) {
display += display == rfpvalue ? rfp_green : rfp_red
display += display == rfpvalue ? rfp_green : rfp_red // mm
log_display(14, type +"_css", (cssvalue == rfpvalue ? rfp_green : rfp_red)) // css
}
}
}
log_display(14, type, display)
res.push([METRIC, value])
res.push([METRIC, value], [METRIC2, cssvalue])
}

let res = []
Expand Down
89 changes: 44 additions & 45 deletions js/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ const get_maxtouch = () => new Promise(resolve => {
})

const get_mm_color = () => new Promise(resolve => {
const METRIC = "color"
function exit(value, display) {
log_display(7, METRIC, display)
return resolve([METRIC, value])
}
const METRIC = "color", METRIC2 = METRIC +"_css"
let isErr = false, value, display
try {
if (runSE) {foo++}
Expand All @@ -85,61 +81,57 @@ const get_mm_color = () => new Promise(resolve => {
} catch(e) {
isErr = true; value = zErr; display = log_error(SECT7, METRIC, e)
}
let cssvalue = getElementProp(SECT7, "#cssC", METRIC2)
let isErrCss = cssvalue == zErr
if (isSmart) {
let cssvalue = getElementProp(SECT7, "#cssC")
if (value !== cssvalue && cssvalue !== "x") {
if (!isErr) {
if (!isErr && !isErrCss) {
if (value !== cssvalue) {
display = colorFn(display)
value = zLIE
log_known(SECT7, METRIC)
}
}
display += display === 8 ? rfp_green : rfp_red
display += display === 8 ? rfp_green : rfp_red // mm
log_display(7, METRIC2, (cssvalue === 8 ? rfp_green : rfp_red)) // css
}
exit(value, display)
log_display(7, METRIC, display)
return resolve([[METRIC, value], [METRIC2, cssvalue]])
})

const get_mm_colorgamut = () => new Promise(resolve => {
const METRIC = "color-gamut"
function exit(value, display) {
log_display(7, METRIC, display)
return resolve([METRIC, value])
}
const METRIC = "color-gamut", METRIC2 = METRIC +"_css"
let value = zNA, display = value, isErr = false
try {
if (runSE) {foo++}
let value = zNA, display = value
let q = "(color-gamut: "
if (window.matchMedia(q +"srgb)").matches) {value = "srgb"}
if (window.matchMedia(q +"p3)").matches) {value = "p3"}
if (window.matchMedia(q +"rec2020)").matches) {value = "rec2020"}
if (runSL) {value = "p3"}
display = value
if (isSmart) {
let cssvalue = getElementProp(SECT7, "#cssCG")
if (value !== cssvalue && cssvalue !== "x") {
} catch(e) {
isErr = true; value = zErr; display = log_error(SECT7, METRIC, e)
}
let cssvalue = getElementProp(SECT7, "#cssCG", METRIC2)
let isErrCss = cssvalue == zErr
if (isSmart) {
if (!isErr && !isErrCss) {
if (value !== cssvalue) {
display = colorFn(display)
value = zLIE
log_known(SECT7, METRIC)
}
// FF110+: 1422237
if (isVer > 109) {
display += display === "srgb" ? rfp_green : rfp_red
}
}
exit(value, display)
} catch(e) {
log_error(SECT7, METRIC, e)
log_display(7, METRIC, zErr + (isSmart ? rfp_red : ""))
return resolve([METRIC, zErr])
// FF110+: 1422237
display += display === "srgb" ? rfp_green : rfp_red // mm
log_display(7, METRIC2, (cssvalue === "srgb" ? rfp_green : rfp_red)) // css
}
log_display(7, METRIC, display)
return resolve([[METRIC, value], [METRIC2, cssvalue]])
})

const get_mm_pointer = (group, type, id, rfpvalue) => new Promise(resolve => {
const METRIC = type
function exit(value, display) {
log_display(7, type, display)
return resolve([METRIC, value])
}
const METRIC = type, METRIC2 = type +"_css"
let value = zNA, display = value, isErr = false
try {
if (runSE) {foo++}
Expand Down Expand Up @@ -168,27 +160,31 @@ const get_mm_pointer = (group, type, id, rfpvalue) => new Promise(resolve => {
display = log_error(SECT7, METRIC, e)
isErr = true; value = zErr
}
let cssvalue = getElementProp(SECT7, id, METRIC2)
let isErrCss = cssvalue == zErr
if (isSmart) {
if (value !== zErr) {
let cssvalue = getElementProp(SECT7, id)
if (group == 2 && cssvalue !== "x") {
let cssvalue2 = getElementProp(SECT7, id, ":before")
if (group == 2 && !isErrCss) {
let cssvalue2 = getElementProp(SECT7, id, METRIC2, ":before")
cssvalue = cssvalue2 + cssvalue
}
if (value !== cssvalue && cssvalue !== "x") {
if (value !== cssvalue && !isErrCss) {
display = colorFn(display)
value = zLIE
log_known(SECT7, METRIC)
}
}
// notate: FF74+ 1607316
if (type == "any-pointer" && isOS !== "android") {
display += display === "fine + fine" ? rfp_green : rfp_red
display += display === "fine + fine" ? rfp_green : rfp_red // mm
log_display(7, METRIC2, (cssvalue === "fine + fine" ? rfp_green : rfp_red)) // css
} else if (isOS == "android") {
display += display === rfpvalue ? rfp_green : rfp_red
display += display === rfpvalue ? rfp_green : rfp_red // mm
log_display(7, METRIC2, (cssvalue === rfpvalue ? rfp_green : rfp_red)) // css
}
}
exit(value, display)
log_display(7, type, display)
return resolve([[METRIC, value], [METRIC2, cssvalue]])
})

const get_media_devices = () => new Promise(resolve => {
Expand All @@ -202,10 +198,14 @@ const get_media_devices = () => new Promise(resolve => {
return value == "TypeError: navigator.mediaDevices is undefined" ? tb_green : tb_red
} else { // RFP
if (isLies) {return (isMullvad ? tb_red : rfp_red)}
let rfplegacy = "02ab1e4c", rfpnew = "7a2e5d0c"
if (isVer < 115) {rfpnew = rfplegacy
} else if (isMullvad) {rfplegacy = rfpnew} // tor-browser#42043
return ((value == rfplegacy || value == rfpnew) ? rfp_green : (isMullvad ? tb_red : rfp_red)) + legacy
let rfplegacy = "02ab1e4c", rfpnew = "7a2e5d0c"
if (isMullvad) {
// tor-browser#42043
return (value == rfpnew ? tb_green : tb_red) + legacy
} else {
// FF: ToDo: 1843434: add version check when flipped
return ((value == rfplegacy || value == rfpnew) ? rfp_green : rfp_red) + legacy
}
}
}
return "" + legacy
Expand Down Expand Up @@ -403,7 +403,6 @@ function get_plugins_mimetypes() {
get_mimetypes(),
]).then(function(results){


return resolve()
})
})
Expand Down
2 changes: 1 addition & 1 deletion js/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const get_element_keys = () => new Promise(resolve => {
const METRIC = "htmlelement_keys"
const id = "html-element-version"
let check = (isSmart && isTB && isVer > 114)
let check = (isSmart && isTB)
let notation = check ? tb_red : ""

function cleanup() {
Expand Down
Loading

0 comments on commit 58e642d

Please sign in to comment.