firefox-devtools / bidi-har-export

Experimental module to compile WebDriver BiDi network events as a HAR file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove console.error log when failing to parse URL.

soulgalore opened this issue · comments

Hi,
when I test cnet.com I get errors on a couple of URLs using Browsertime:

Failed to parse query string for url https://geo.moatads.com/n.js?e=35&ol=0&qn=%604%7BZEYwoqI%24%5BK%2BdLLU)%2CMm~ts!90vv9L%24%2FoDb%2FDXwJN%5EpBKUYBgDzb%23Ls1(u0EnUa%3Fwb%26k!C%24%26J%3BuFdSh%3F%24b%40o~%2Fj%24Co%3DN_Q%247NCLm%3C6Hu_SOy7j3Ms11%5D(RxT20vm!jo84BKm55t%2630987jPPef!N%24or1%3E%5BsYej.UghO%5B.%22%24b_o%3FtaU%24(9N%2CNJJ)%2CW%2FKo7FY&tf=1_nMzjG---CSa7H-IDtCXC-bW7qhB-LRwqH-nMzjG-&vi=111111&rc=0%2C0%2C0%2C5%2C747835005%2C1%2C2%2C0%2Cprobably%2Cprobably&rb=1-EpoJRafKKw2oRflATadkAjYAbl2mwqO9YGxLYqfZY0xNzxzrCfSmix1wV0AK2nh7uzk%3D&rs=1-5ZHC8HxEcQEJWg%3D%3D&sc=1&os=1-SA%3D%3D&qp=01000&is=BBBBB2BBEY4vGl2BBCBBtBBE1RmsqBBB8BsrBu0rCBE48CRBeeBS2hWTMBBQeQBOn2soYggyUig0CBlWZ0BNpKzisfZOgRBBiOfnE6Bkg7Oxib8MBBBBBHCBBBBBBhIcb9YBoBXckXBR7BBUUsJBCBBBBBBBBBWBBBj3BBBZeGB2BBB5MCBBHBBCgEBBBBBB94UMgTdJMtEcpMBBBQBBBniOccypwswB47kNBBBBBBBBBBBBBhcjG6BBJM2L4Bk8BwHBQmIBRBBCzmz1BBCTClBBrbBBC4ehueB57NG9aJfR0BBBBBBBBBBB&iv=8&qt=0&gz=0&hh=0&hn=0&tw=&qc=0&qd=25&qf=1366&qe=683&qh=1366&qg=768&qm=-120&qa=1680&qb=1050&qi=1680&qj=983&to=000&po=1-0020002000002120&vy=ot%24b%5Bh%40%22oDTF%2BGrIc%5E%5E%5E~l~Umfz%5DO%22oD_h%25RVGX%5E8Y.Nl5K%22QpCtYb8p%5EzVK9_5*RpY%3CZ.e&qr=0&ql=%3B%5BpwxnRd%7Dt%3Aa%5DmJVOG)%2C~%405%2F%5BGI%3F6C(TgPB*e%5D1(rI%24(rj2Iy!pw%40aOS%3DyNX8Y%7BQgPB*e%5D1(rI%24(rj%5EB61%2F%3DSqcMr1%7B%2CJA%24Jz_%255tTL%3Fwbs_T%234%25%60X%3CA&qo=0&i=REDVENTURES_GAM_HEADER1&hp=1&wf=1&sgs=3&bo=undefined&bp=undefined&bd=undefined&zMoatNotCnet=true&zMoatPT=Not%20Specified&zMoatFT=Not%20Specified&zMoatSZ=Not%20Specified&zMoatPS=Not%20Specified&zMoatSZPS=Not%20Specified&zMoatPTAT=Not%20Specified&zMoatPTATSECT=Not%20Specified&vb=-1&kq=2&hq=0&hs=0&hu=0&hr=1&ht=0&dnt=0&bq=11&f=0&j=&t=1686669880752&de=192867852692&rx=486116006306&m=0&ar=fde231f50fe-clean&iw=07dcc4a&q=2&cb=0&cu=1686669880752&ll=2&lm=0&ln=0&em=0&en=0&d=undefined%3Aundefined%3Aundefined%3Aundefined&zGSRS=1&zGSRC=1&gu=https%3A%2F%2Fwww.cnet.com%2F&id=1&ii=4&zMoatOrigSlicer1=undefined&zMoatOrigSlicer2=undefined&dfp=true&la=undefined&gw=redventuresgamheader644747280705&fd=1&it=500&ti=0&ih=2&pe=1%3A-%3A499%3A2127%3A483&jk=-1&jm=-1&fs=203695&na=862600258&cs=0&callback=MoatDataJsonpRequest_18989564
URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at /Users/peter/git/browsertime/node_modules/ff-test-bidi-har-export/src/har-recorder.js:45:16

I'm thinking this maybe is not so useful info, so we can just remove the error logs (or even better if we have debug logs turned on, we log), since we just swallow the problem and return an empty array?

I can make a PR for it but wanted to check with you first.

Guarding that behind the _debugLogs makes sense, or simply silencing it.

But I actually think the decodeURIComponent is a mistake. The values should already be decoded, so this additional attempt to call decodeURIComponent is wrong.

@soulgalore released v0.0.11 on npm which should include this fix