-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(major improvements on pp detection and speed): speeding up the p…
…robing functions
- Loading branch information
1 parent
a1cceb0
commit a8edb04
Showing
8 changed files
with
64 additions
and
33 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
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
Binary file not shown.
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,5 +1,34 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<script id="target"></script> | ||
</html> | ||
<script id="payload"> | ||
const types = [Object, String, Number, Array, Function, Boolean]; | ||
|
||
const prototypesPropertiesReducer = (acc, type) => ({ | ||
...acc, | ||
[type.name]: Object.getOwnPropertyNames(type.prototype), | ||
}); | ||
|
||
const prototypePropertyNames = () => types.reduce(prototypesPropertiesReducer, {}); | ||
|
||
const probe = () => | ||
Object.keys(prototypePropertyNames()).reduce((acc, key) => { | ||
for (let propKey of prototypePropertyNames()[key]) { | ||
const payload = `${key}.prototype.${propKey}`; | ||
try { | ||
const propValue = eval(payload); | ||
|
||
if (typeof propValue === 'function' && !propValue.toString().includes('[native code]')) { | ||
// Check if property is user defined and not native | ||
acc.push(payload); | ||
} | ||
} catch (e) { | ||
// Nothing to catch now. | ||
} | ||
} | ||
return acc; | ||
}, []); | ||
</script> | ||
<script id="target" src="LIBRARY"></script> | ||
|
||
</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
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