Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
5ca8f28f
Commit
5ca8f28f
authored
Aug 03, 2023
by
wangmingming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
333
parent
fd388530
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6418 additions
and
4800 deletions
+6418
-4800
js_dom_run.js
js_dom_run.js
+3199
-19
Window.js
jsdom/lib/jsdom/browser/Window.js
+2
-2
Navigator.js
jsdom/lib/jsdom/living/generated/Navigator.js
+1
-0
Screen.js
jsdom/lib/jsdom/living/generated/Screen.js
+193
-113
Navigator-impl.js
jsdom/lib/jsdom/living/navigator/Navigator-impl.js
+1
-0
NavigatorID-impl.js
jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js
+15
-0
Screen-impl.js
jsdom/lib/jsdom/living/window/Screen-impl.js
+7
-0
src_out.js
src_out.js
+3000
-4666
No files found.
js_dom_run.js
View file @
5ca8f28f
This diff is collapsed.
Click to expand it.
jsdom/lib/jsdom/browser/Window.js
View file @
5ca8f28f
...
...
@@ -3,7 +3,7 @@ let proxy = function (tt, name) {
get
(
target
,
p
,
receiver
)
{
let
res
=
Reflect
.
get
(
target
,
p
,
receiver
);
console
.
log
(
`
${
name
}
get`
,
p
,
typeof
res
)
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'_eventListenerss'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'_eventListenerss'
,
'JSON'
,
'Math'
,
'JSON'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
return
proxy
(
res
,
`
${
name
}
.
${
p
}
`
)
}
return
res
;
...
...
@@ -274,7 +274,7 @@ function Window(options) {
// }
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'performance'
,
'debug'
,
'_eventListenerss'
,
'top'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'performance'
,
'debug'
,
'_eventListenerss'
,
'top'
,
'JSON'
,
'Math'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
return
proxy
(
res
,
p
)
}
return
res
;
...
...
jsdom/lib/jsdom/living/generated/Navigator.js
View file @
5ca8f28f
...
...
@@ -274,6 +274,7 @@ exports.install = (globalObject, globalNames) => {
}
get
userAgent
()
{
return
window
.
fingerprint
.
navigator
.
userAgent
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
jsdom/lib/jsdom/living/generated/Screen.js
View file @
5ca8f28f
...
...
@@ -14,7 +14,7 @@ exports.is = value => {
exports
.
isImpl
=
value
=>
{
return
utils
.
isObject
(
value
)
&&
value
instanceof
Impl
.
implementation
;
};
exports
.
convert
=
(
value
,
{
context
=
"The provided value"
}
=
{})
=>
{
exports
.
convert
=
(
value
,
{
context
=
"The provided value"
}
=
{})
=>
{
if
(
exports
.
is
(
value
))
{
return
utils
.
implForWrapper
(
value
);
}
...
...
@@ -44,7 +44,8 @@ exports.createImpl = (globalObject, constructorArgs, privateData) => {
return
utils
.
implForWrapper
(
wrapper
);
};
exports
.
_internalSetup
=
(
wrapper
,
globalObject
)
=>
{};
exports
.
_internalSetup
=
(
wrapper
,
globalObject
)
=>
{
};
exports
.
setup
=
(
wrapper
,
globalObject
,
constructorArgs
=
[],
privateData
=
{})
=>
{
privateData
.
wrapper
=
wrapper
;
...
...
@@ -84,12 +85,15 @@ exports.install = (globalObject, globalNames) => {
if
(
!
globalNames
.
some
(
globalName
=>
exposed
.
has
(
globalName
)))
{
return
;
}
class
Screen
{
constructor
()
{
throw
new
TypeError
(
"Illegal constructor"
);
}
get
availWidth
()
{
return
window
.
fingerprint
.
screen
.
availWidth
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -100,6 +104,8 @@ exports.install = (globalObject, globalNames) => {
}
get
availHeight
()
{
return
window
.
fingerprint
.
screen
.
availHeight
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -110,6 +116,8 @@ exports.install = (globalObject, globalNames) => {
}
get
width
()
{
return
window
.
fingerprint
.
screen
.
width
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -120,6 +128,8 @@ exports.install = (globalObject, globalNames) => {
}
get
height
()
{
return
window
.
fingerprint
.
screen
.
height
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -130,6 +140,8 @@ exports.install = (globalObject, globalNames) => {
}
get
colorDepth
()
{
return
window
.
fingerprint
.
screen
.
colorDepth
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -140,6 +152,7 @@ exports.install = (globalObject, globalNames) => {
}
get
pixelDepth
()
{
return
window
.
fingerprint
.
screen
.
pixelDepth
;
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
if
(
!
exports
.
is
(
esValue
))
{
...
...
@@ -148,15 +161,82 @@ exports.install = (globalObject, globalNames) => {
return
esValue
[
implSymbol
][
"pixelDepth"
];
}
get
availTop
()
{
return
window
.
fingerprint
.
screen
.
availTop
}
get
availLeft
()
{
return
window
.
fingerprint
.
screen
.
availLeft
}
get
innerHeight
()
{
return
window
.
fingerprint
.
screen
.
innerHeight
}
get
outerHeight
()
{
return
window
.
fingerprint
.
screen
.
outerHeight
}
get
outerWidth
()
{
return
window
.
fingerprint
.
screen
.
outerWidth
}
get
innerWidth
()
{
return
window
.
fingerprint
.
screen
.
innerWidth
}
get
screenX
()
{
return
window
.
fingerprint
.
screen
.
screenX
}
get
pageXOffset
()
{
return
window
.
fingerprint
.
screen
.
pageXOffset
}
get
pageYOffset
()
{
return
window
.
fingerprint
.
screen
.
pageYOffset
}
get
devicePixelRatio
()
{
return
window
.
fingerprint
.
screen
.
devicePixelRatio
}
get
clientWidth
()
{
return
window
.
fingerprint
.
screen
.
clientWidth
}
get
clientHeight
()
{
return
window
.
fingerprint
.
screen
.
clientHeight
}
get
hasHDR
()
{
return
window
.
fingerprint
.
screen
.
hasHDR
}
}
Object
.
defineProperties
(
Screen
.
prototype
,
{
availWidth
:
{
enumerable
:
true
},
availHeight
:
{
enumerable
:
true
},
width
:
{
enumerable
:
true
},
height
:
{
enumerable
:
true
},
colorDepth
:
{
enumerable
:
true
},
pixelDepth
:
{
enumerable
:
true
},
[
Symbol
.
toStringTag
]:
{
value
:
"Screen"
,
configurable
:
true
}
availWidth
:
{
enumerable
:
true
},
availHeight
:
{
enumerable
:
true
},
width
:
{
enumerable
:
true
},
height
:
{
enumerable
:
true
},
colorDepth
:
{
enumerable
:
true
},
pixelDepth
:
{
enumerable
:
true
},
availTop
:
{
enumerable
:
true
},
availLeft
:
{
enumerable
:
true
},
innerHeight
:
{
enumerable
:
true
},
outerHeight
:
{
enumerable
:
true
},
outerWidth
:
{
enumerable
:
true
},
innerWidth
:
{
enumerable
:
true
},
screenX
:
{
enumerable
:
true
},
pageXOffset
:
{
enumerable
:
true
},
pageYOffset
:
{
enumerable
:
true
},
devicePixelRatio
:
{
enumerable
:
true
},
clientWidth
:
{
enumerable
:
true
},
clientHeight
:
{
enumerable
:
true
},
hasHDR
:
{
enumerable
:
true
},
[
Symbol
.
toStringTag
]:
{
value
:
"Screen"
,
configurable
:
true
}
});
if
(
globalObject
[
ctorRegistrySymbol
]
===
undefined
)
{
globalObject
[
ctorRegistrySymbol
]
=
Object
.
create
(
null
);
...
...
jsdom/lib/jsdom/living/navigator/Navigator-impl.js
View file @
5ca8f28f
...
...
@@ -13,6 +13,7 @@ class NavigatorImpl {
constructor
(
globalObject
,
args
,
privateData
)
{
this
.
_globalObject
=
globalObject
;
this
.
userAgent
=
privateData
.
userAgent
;
// this.userAgent = window.fingerprint.navigator.userAgent;
this
.
languages
=
Object
.
freeze
([
"en-US"
,
"en"
]);
this
.
plugins
=
PluginArray
.
create
(
this
.
_globalObject
);
this
.
mimeTypes
=
MimeTypeArray
.
create
(
this
.
_globalObject
);
...
...
jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js
View file @
5ca8f28f
...
...
@@ -2,36 +2,51 @@
exports
.
implementation
=
class
NavigatorIDImpl
{
get
appCodeName
()
{
return
window
.
fingerprint
.
navigator
.
appCodeName
return
"Mozilla"
;
}
get
appName
()
{
return
window
.
fingerprint
.
navigator
.
appName
return
"Netscape"
;
}
get
appVersion
()
{
return
window
.
fingerprint
.
navigator
.
appVersion
return
"4.0"
;
}
get
platform
()
{
return
window
.
fingerprint
.
navigator
.
platform
return
""
;
}
get
product
()
{
return
window
.
fingerprint
.
navigator
.
product
return
"Gecko"
;
}
get
productSub
()
{
return
window
.
fingerprint
.
navigator
.
productSub
return
"20030107"
;
}
// see Navigator constructor for userAgent
get
vendor
()
{
return
window
.
fingerprint
.
navigator
.
vendor
return
"Apple Computer, Inc."
;
}
get
vendorSub
()
{
return
window
.
fingerprint
.
navigator
.
vendorSub
return
""
;
}
};
jsdom/lib/jsdom/living/window/Screen-impl.js
View file @
5ca8f28f
...
...
@@ -10,4 +10,11 @@ ScreenImpl.prototype.height = 0;
ScreenImpl
.
prototype
.
colorDepth
=
24
;
ScreenImpl
.
prototype
.
pixelDepth
=
24
;
// ScreenImpl.prototype.availWidth = window.fingerprint.screen.availWidth;
// ScreenImpl.prototype.availHeight = window.fingerprint.screen.availHeight;
// ScreenImpl.prototype.width = window.fingerprint.screen.width;
// ScreenImpl.prototype.height = window.fingerprint.screen.height;
// ScreenImpl.prototype.colorDepth = window.fingerprint.screen.colorDepth;
// ScreenImpl.prototype.pixelDepth = window.fingerprint.screen.pixelDepth;
exports
.
implementation
=
ScreenImpl
;
src_out.js
View file @
5ca8f28f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment