Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (() => {
- let idx = 0
- let isEnd = false
- let full_list = [document]
- let find_names = ["claim", "claimID"]
- function parse(obj, obj_name, line_names=[]) {
- if(isEnd) return
- if(obj == null) return
- if(typeof obj != "object") return
- if(['ServiceWorkerContainer'].includes(obj_name)) return
- if(full_list.includes(obj)) return
- full_list.push(obj)
- line_names.push(obj_name)
- idx += 1;
- if(idx % 1000 == 0) {
- console.log("idx:", idx)
- // console.log(line_names)
- // setTimeout(() => {
- // parse(obj, obj_name, line_names)
- // }, 100)
- // return
- }
- if(find_names.includes(obj_name)) {
- console.log("============== FIND SUCCESS ==============")
- console.log(line_names)
- isEnd = true
- return
- }
- for(let child_name in obj) {
- let _child_obj = null
- try {
- _child_obj = obj[child_name]
- if(_child_obj != null && typeof _child_obj.then === 'function'){
- _child_obj.then((x) => {
- parse(x, child_name, line_names)
- })
- continue
- }
- } catch (error) {}
- if(_child_obj != null){
- parse(_child_obj, child_name, line_names)
- }
- if(isEnd) return
- }
- let _proto = null
- try {
- _proto = obj.__proto__
- } catch (error) {}
- if (_proto!=null){
- parse(_proto, "__proto__", line_names)
- }
- line_names.splice(-1,1)
- }
- parse(window, 'window')
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement