程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何从 chrome 获取 DOM.shadowRootPushed 事件?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决如何从 chrome 获取 DOm.shadowRootPushed 事件??

开发过程中遇到如何从 chrome 获取 DOm.shadowRootPushed 事件?的问题如何解决?下面主要结合日常开发的经验,给出你关于如何从 chrome 获取 DOm.shadowRootPushed 事件?的解决方法建议,希望对你解决如何从 chrome 获取 DOm.shadowRootPushed 事件?有所启发或帮助;

我一直在尝试使用 DOm.shadowRootPushed 中的 CDPSession 获取 puppeteer 事件。 这是加载包含 shadowRoot 的页面:

<HTML>
<head>
  <title>
    Page with Shadow Root
  </title>
</head>
<body>
  <header ID="host">
    <h1>Hello DOM</h1>
  </header>
</body>
<script>
  var attachShadow = HTMLElement.prototype.attachShadow

  HTMLElement.prototype.attachShadow = function ( option )
  {
    var sh = attachShadow.call( this,option )
    console.info( '%s shadow attached to %s',option.mode,this )
    //add a MutationObserver here
    return sh
  }
  setTimeout(function() {
    const host = document.getElementByID('host');
    const shadowRoot = host.attachShadow({mode: 'open'});
    shadowRoot.INNERHTML = '<h1>Hello Shadow DOM</h1>';
  },3300);
</script>
</HTML>

而且,我使用这个本来获取事件:

const puppeteer = require('puppeteer');

(async() => {
  // Use Puppeteer to launch a browser and open a page.
  const browser = await puppeteer.launch({
      headless: false
      // userDataDir: "/home/w/.config/chromium/"
    });
  const page = await browser.newPage();

  // Create a raw DevTools protocol session to talk to the page.
  // Use CDP to set the animation playBACk rate.
  const session = await page.target().createCDPSession();
  await session.send('Animation.enable');
  await session.send('DOm.enable');
  
  session.on('Animation.animationCreated',() => {
    console.log('Animation created!');
  });
  session.on('DOm.shadowRootPushed',() => {
    console.log('DOm.shadowRootPushed');
  });
  session.on('DOm.shadowRootPopped',() => {
    console.log('DOm.shadowRootPopped');
  });

  await session.send('Animation.setPlayBACkRate',{
    playBACkRate: 2,});


  // check it out! Fast animations on the "loading..." screen!
  // await page.goto('https://pptr.dev');
  await page.goto('http://localhost:8000');
  await wait(1115000)
  console.log("Done")
})();

async function wait(ms) {
  return new Promise(resolve => setTimeout(resolve,ms));
}

不过我得到了 Animation.animationCreated。 CDP 网站说 DOm.shadowRootPushed 是一个实验性事件。是否需要在启动选项中传递标志? 依赖项:

  "dependencIEs": {
    "puppeteer": "8.0.0","ws": "7.2.3"
  },

Chrome Version版本 90.0.4427.0(开发者版本)(64 位)

调试日志:

$ DEBUG=* node cdpsession.Js 
  puppeteer:protocol SEND ► {"method":"Target.setdiscoverTargets","params":{"discover":truE},"ID":1} +0ms
  puppeteer:protocol ◀ RECV {"method":"Target.targetCreated","params":{"targeTinfo":{"targetID":"3462A6199ADAF347FD96DF0016967C81","type":"page","title":"","url":"about:blank","attached":false,"browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +41ms
  puppeteer:protocol ◀ RECV {"method":"Target.targetCreated","params":{"targeTinfo":{"targetID":"3995d8d1-5e35-48ff-b5c6-faf339b9ec9a","type":"browser","url":"","attached":truE}}} +1ms
  puppeteer:protocol ◀ RECV {"ID":1,"result":{}} +0ms
  puppeteer:protocol SEND ► {"method":"Target.createTarget","params":{"url":"about:blank"},"ID":2} +1ms
  puppeteer:protocol ◀ RECV {"method":"Target.targeTinfoChanged","title":"about:blank","browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +6ms
  puppeteer:protocol ◀ RECV {"method":"Target.targetCreated","params":{"targeTinfo":{"targetID":"6DAD742822835DE715BE5F8B09EC00BD","browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +13ms
  puppeteer:protocol ◀ RECV {"ID":2,"result":{"targetID":"6DAD742822835DE715BE5F8B09EC00BD"}} +11ms
  puppeteer:protocol SEND ► {"method":"Target.attach@R_281_10586@rget","params":{"targetID":"6DAD742822835DE715BE5F8B09EC00BD","flatten":truE},"ID":3} +0ms
  puppeteer:protocol ◀ RECV {"method":"Target.targeTinfoChanged","attached":true,"browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +18ms
  puppeteer:protocol ◀ RECV {"method":"Target.attached@R_281_10586@rget","params":{"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","targeTinfo":{"targetID":"6DAD742822835DE715BE5F8B09EC00BD","browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"},"waiTingForDeBUGger":falsE}} +1ms
  puppeteer:protocol ◀ RECV {"ID":3,"result":{"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"}} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.enable","params":{},"ID":4} +1ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.getFrameTree","ID":5} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Target.setautoAttach","params":{"autoAttach":true,"waitForDeBUGgerOnStart":false,"ID":6} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"PerfoRMANce.enable","ID":7} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Log.enable","ID":8} +1ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.seTinterceptfileChooserDialog","params":{"enabled":truE},"ID":9} +0ms
  puppeteer:protocol ◀ RECV {"method":"Target.targeTinfoChanged","browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +11ms
  puppeteer:protocol ◀ RECV {"ID":9,"result":{},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +4ms
  puppeteer:protocol ◀ RECV {"ID":4,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +13ms
  puppeteer:protocol ◀ RECV {"ID":5,"result":{"frameTree":{"frame":{"ID":"6DAD742822835DE715BE5F8B09EC00BD","loaderID":"C4bedF25BD814B4DC16699169B6EF1F7","securityOrigin":"://","mimeType":"text/HTML"}}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.setlifecycleEventsEnabled","ID":10} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Runtime.enable","ID":11} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Network.enable","ID":12} +0ms
  puppeteer:protocol ◀ RECV {"ID":6,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol ◀ RECV {"ID":7,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Log.entryAdded","params":{"entry":{"source":"other","level":"error","text":"Site cAnnot be installed: Page is not served from a secure origin","timestamp":1618302904174.339,"url":"about:blank"}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":8,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","params":{"framEID":"6DAD742822835DE715BE5F8B09EC00BD","name":"commit","timestamp":195993.959226},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +4ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","name":"DOMContentLoaded","timestamp":195993.959313},"name":"load","timestamp":195993.961627},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","name":"networkAlmostIDle","timestamp":195993.961976},"name":"networkIDle","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":10,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Runtime.executionContextCreated","params":{"context":{"ID":1,"origin":"://","name":"","auxData":{"isDefault":true,"type":"default","framEID":"6DAD742822835DE715BE5F8B09EC00BD"}}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":11,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":12,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.addScriptToEvaluateOnNewdocument","params":{"source":"//# sourceURL=__puppeteer_evaluation_script__","worldname":"__puppeteer_utility_world__"},"ID":13} +0ms
  puppeteer:protocol ◀ RECV {"ID":13,"result":{"IDentifIEr":"1"},"method":"Page.createIsolateDWorld","grantUniveralAccess":true,"ID":14} +0ms
  puppeteer:protocol ◀ RECV {"method":"Runtime.executionContextCreated","params":{"context":{"ID":2,"origin":"","name":"__puppeteer_utility_world__","auxData":{"isDefault":false,"type":"isolated","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +4ms
  puppeteer:protocol ◀ RECV {"ID":14,"result":{"executionContextID":2},"method":"Emulation.setDeviceMetricsOverrIDe","params":{"mobile":false,"wIDth":800,"height":600,"deviceScaleFactor":1,"screenorIEntation":{"angle":0,"type":"porTraitPriMary"}},"ID":15} +1ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Emulation.settouchEmulationEnabled","params":{"enabled":falsE},"ID":16} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameResized","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +4ms
  puppeteer:protocol ◀ RECV {"ID":15,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":16,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol SEND ► {"method":"Target.attach@R_281_10586@rget","ID":17} +0ms
  puppeteer:protocol ◀ RECV {"method":"Target.attached@R_281_10586@rget","params":{"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15","waiTingForDeBUGger":falsE}} +1ms
  puppeteer:protocol ◀ RECV {"ID":17,"result":{"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"}} +0ms
  puppeteer:protocol SEND ► {"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15","method":"Animation.enable","ID":18} +1ms
  puppeteer:protocol ◀ RECV {"ID":18,"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol SEND ► {"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15","ID":19} +0ms
  puppeteer:protocol ◀ RECV {"ID":19,"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +1ms
  puppeteer:protocol SEND ► {"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15","method":"DOm.enable","ID":20} +0ms
  puppeteer:protocol ◀ RECV {"ID":20,"method":"Animation.setPlayBACkRate","params":{"playBACkRate":2},"ID":21} +1ms
  puppeteer:protocol ◀ RECV {"ID":21,"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +4ms
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Page.navigate","params":{"url":"http://localhost:8000","framEID":"6DAD742822835DE715BE5F8B09EC00BD"},"ID":22} +3ms
  puppeteer:protocol ◀ RECV {"method":"Network.requestwillBeSent","params":{"requestID":"946E1DE1FC063361360B31998681705C","loaderID":"946E1DE1FC063361360B31998681705C","documentURL":"http://localhost:8000/","request":{"url":"http://localhost:8000/","method":"GET","headers":{"sec-ch-ua":"Chromium 78","upgrade-insecure-requests":"1","User-Agent":"Mozilla/5.0 (X11; linux x86_64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3882.0 Safari/537.36","Sec-Fetch-Dest":"document","sec-fetch-mode":"navigate","Sec-Fetch-User":"?1"},"mixedContentType":"none","initialPriority":"VeryHigh","referrerPolicy":"no-referrer-when-downgrade"},"timestamp":195994.030865,"wallTime":1618302904.223556,"initiator":{"type":"other"},"type":"document","framEID":"6DAD742822835DE715BE5F8B09EC00BD","hasUserGesture":falsE},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +5ms
  puppeteer:protocol ◀ RECV {"method":"Network.responseReceivedExTrainfo","blockedcookies":[],"headers":{"Server":"Simplehttp/0.6 Python/3.8.5","Date":"Tue,13 Apr 2021 07:33:36 GMT","Content-type":"text/HTML","Content-Length":"656","Last-ModifIEd":"Mon,12 Apr 2021 17:02:56 GMT"},"headersText":"http/1.0 200 OK\r\nServer: Simplehttp/0.6 Python/3.8.5\r\nDate: Tue,13 Apr 2021 07:33:36 GMT\r\nContent-type: text/HTML\r\nContent-Length: 656\r\nLast-ModifIEd: Mon,12 Apr 2021 17:02:56 GMT\r\n\r\n"},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +4ms
  puppeteer:protocol ◀ RECV {"method":"Network.responseReceived","timestamp":195994.034773,"response":{"url":"http://localhost:8000/","status":200,"statusText":"OK",12 Apr 2021 17:02:56 GMT\r\n\r\n","mimeType":"text/HTML","connectionReused":false,"connectionID":0,"remoteIpaddress":"127.0.0.1","remotePort":8000,"fromdiskCache":true,"fromserviceWorker":false,"fromPrefetchCache":false,"encodedDataLength":0,"timing":{"requestTime":195994.031508,"proxyStart":-1,"proxyEnd":-1,"dnsstart":-1,"dnsEnd":-1,"connectStart":-1,"connectEnd":-1,"sslStart":-1,"sslEnd":-1,"workerStart":-1,"workerReady":-1,"sendStart":0.047,"sendEnd":0.047,"pushStart":0,"pushEnd":0,"receiveheadersEnd":0.252},"protocol":"http/1.0","securityState":"secure"},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"ID":22,"result":{"framEID":"6DAD742822835DE715BE5F8B09EC00BD","loaderID":"946E1DE1FC063361360B31998681705C"},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +2ms
  puppeteer:protocol ◀ RECV {"method":"Target.targeTinfoChanged","title":"localhost:8000","url":"http://localhost:8000/","browserContextID":"9DD61B1C854229B47F6F3A16F46B1AF0"}}} +27ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameStartedLoading","params":{"framEID":"6DAD742822835DE715BE5F8B09EC00BD"},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +2ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","name":"init","timestamp":195994.038172},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Runtime.executionContextDestroyed","params":{"executionContextID":1},"params":{"executionContextID":2},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Runtime.executionContextsCleared","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameNavigated","params":{"frame":{"ID":"6DAD742822835DE715BE5F8B09EC00BD","securityOrigin":"http://localhost:8000","mimeType":"text/HTML"}},"params":{"context":{"ID":3,"origin":"http://localhost:8000","params":{"context":{"ID":4,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameStartedLoading","sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameNavigated","sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"DOm.documentupdated","sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Network.dataReceived","timestamp":195994.066566,"dataLength":656,"encodedDataLength":0},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +3ms
  puppeteer:protocol ◀ RECV {"method":"Network.loadingFinished","timestamp":195994.032156,"shouldReportCorbBlocking":falsE},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.loadEventFired","params":{"timestamp":195994.070869},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +45ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","timestamp":195994.070869},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameStoppedLoading","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.domContentEventFired","params":{"timestamp":195994.097616},"timestamp":195994.097616},"params":{"timestamp":195994.070878},"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.frameStoppedLoading","sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +1ms
  puppeteer:protocol ◀ RECV {"method":"DOm.documentupdated","sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Page.domContentEventFired","params":{"timestamp":195994.09762},"sessionID":"0313B2AD0426A7188BC93EBA3D6F8D15"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Log.entryAdded","text":"Site cAnnot be installed: Page has no manifest <link> URL","timestamp":1618302904323.69,"url":"http://localhost:8000/"}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +18ms
  puppeteer:protocol ◀ RECV {"method":"Network.requestwillBeSent","params":{"requestID":"1000037436.2","request":{"url":"http://localhost:8000/favicon.ico","sec-fetch-mode":"no-cors","Referer":"http://localhost:8000/","Sec-Fetch-Dest":"image",like Gecko) Chrome/78.0.3882.0 Safari/537.36"},"initialPriority":"High","timestamp":195994.132074,"wallTime":1618302904.324764,"type":"Other","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol ◀ RECV {"method":"Network.requestwillBeSentexTrainfo","headers":{"Host":"localhost:8000","Connection":"keep-alive","sec-ch-ua":"Chromium 78","Accept":"image/webp,image/apng,image/*,*/*;q=0.8","sec-fetch-site":"same-origin","Accept-EnCoding":"gzip,deflate,br","Accept-Language":"en-GB,en-US;q=0.9,en;q=0.8"}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Network.responseReceivedExTrainfo",13 Apr 2021 08:35:04 GMT","Connection":"close","Content-Type":"text/HTML;charset=utf-8","Content-Length":"469"},"headersText":"http/1.0 404 file not found\r\nServer: Simplehttp/0.6 Python/3.8.5\r\nDate: Tue,13 Apr 2021 08:35:04 GMT\r\nConnection: close\r\nContent-Type: text/HTML;charset=utf-8\r\nContent-Length: 469\r\n\r\n"},"timestamp":195994.136327,"response":{"url":"http://localhost:8000/favicon.ico","status":404,"statusText":"file not found","headers":{"Date":"Tue,"Server":"Simplehttp/0.6 Python/3.8.5","Content-Length":"469","Content-Type":"text/HTML;charset=utf-8"},"connectionReused":true,"connectionID":21,"fromdiskCache":false,"encodedDataLength":184,"timing":{"requestTime":195994.132935,"sendStart":0.164,"sendEnd":0.222,"receiveheadersEnd":2.581},"params":{"entry":{"source":"network","text":"Failed to load resource: the server responded with a status of 404 (file not found)","timestamp":1618302904329.0269,"url":"http://localhost:8000/favicon.ico","networkrequestID":"1000037436.2"}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Network.dataReceived","timestamp":195994.136494,"dataLength":469,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms
  puppeteer:protocol ◀ RECV {"method":"Network.dataReceived","timestamp":195994.136661,"dataLength":0,"encodedDataLength":469},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Network.loadingFinished","timestamp":195994.135926,"encodedDataLength":653,"name":"firstPaint","timestamp":195994.137751},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +8ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","name":"firstContentfulPaint","name":"firstmeaningfulPaintCandIDate","sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +12ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","timestamp":195994.097621},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +639ms
  puppeteer:protocol ◀ RECV {"method":"Page.lifecycleEvent","name":"firstmeaningfulPaint","timestamp":195994.136668},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +0ms
  puppeteer:protocol ◀ RECV {"method":"Runtime.consoleAPICalled","params":{"type":"info","args":[{"type":"String","value":"+9s shadow attached to %s"},{"type":"String","value":"open"},{"type":"object","subtype":"node","classname":"HTMLElement","description":"header#host","objectID":"{\"injectedScriptID\":3,\"ID\":1}","prevIEw":{"type":"object","overflow":true,"propertIEs":[{"name":"title","type":"String","value":""},{"name":"lang",{"name":"translate","type":"Boolean","value":"true"},{"name":"dir",{"name":"dataset","type":"object","value":"DOMStringMap"}]}}],"executionContextID":3,"timestamp":1618302914264.107,"stackTrace":{"callFrames":[{"functionname":"HTMLElement.attachShadow","scriptID":"14","linenumber":17,"columnnumber":12},{"functionname":"","linenumber":23,"columnnumber":28}]}},"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"}
  puppeteer:protocol SEND ► {"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB","method":"Runtime.releaSEObject","params":{"objectID":"{\"injectedScriptID\":3,\"ID\":1}"},"ID":23} +1ms
  puppeteer:protocol ◀ RECV {"ID":23,"sessionID":"D9D90F0C9845C459A09442F9B0E0F0EB"} +1ms

更新:

根据评论,我添加了以下标志:

args: [
        '--enable-blink-test-features','--enable-experimental-web-platform-features','--fake-variations-chAnnel=canary'
      ]

并为 dev 应用 betacanarystable--fake-variations-chAnnel。未捕获通知。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的如何从 chrome 获取 DOM.shadowRootPushed 事件?全部内容,希望文章能够帮你解决如何从 chrome 获取 DOM.shadowRootPushed 事件?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。