OpenBullet2 icon indicating copy to clipboard operation
OpenBullet2 copied to clipboard

[Bug]: Unhandled exception on puppeteer close browser

Open teidova opened this issue 3 years ago • 0 comments

Version of the software

0.2.5

Operating system

Windows 11

Browser / Native

Mozilla

What happened?

On browser close, OB2 Crashes and there is the error in the command line :

Unhandled exception. Unhandled exception. Unhandled exception. PuppeteerSharp.TargetClosedException: Protocol error(Page.addScriptToEvaluateOnNewDocument): Target closed. (Target.detachedFromTarget)
   at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback)
   at PuppeteerSharp.FrameManager.EnsureIsolatedWorldAsync(String name)
   at PuppeteerSharp.FrameManager.CreateFrameManagerAsync(CDPSession client, Page page, Boolean ignoreHTTPSErrors, TimeoutSettings timeoutSettings)
   at PuppeteerSharp.Page.InitializeAsync(Boolean ignoreHTTPSErrors)
   at PuppeteerSharp.Page.CreateAsync(CDPSession client, Target target, Boolean ignoreHTTPSErrors, ViewPortOptions defaultViewPort, TaskQueue screenshotTaskQueue)
   at PuppeteerSharp.Target.CreatePageAsync()
   at PuppeteerExtraSharp.PuppeteerExtra.<>c__DisplayClass9_0.<<Register>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

I tried using safe mode but it doesn't catch it, I tried to catch it myself but I failed (maybe I'm dumb but it's probably a bug).

Relevant LoliCode if needed

BLOCK:PuppeteerOpenBrowser
ENDBLOCK

BLOCK:PuppeteerNavigateTo
  url = "https://google.fr"
  loadedEvent = DOMContentLoaded
ENDBLOCK

BLOCK:PuppeteerGetAttributeValue
  findBy = Selector
  identifier = "body>div>div:nth-child(2)>div>img"
  index = 0
  attributeName = "src"
  => VAR @supersrc
ENDBLOCK

BLOCK:PuppeteerCloseBrowser
ENDBLOCK

teidova avatar Jan 21 '23 09:01 teidova