swagger-viewer icon indicating copy to clipboard operation
swagger-viewer copied to clipboard

Cause error

Open nekowasabi opened this issue 2 years ago • 5 comments

I am trying to display swagger by extension in yml on github, and now I get the following error message.

How can I configure it to fix the problem?

Error: Unexpected DOM. Probably GitHub has been updated. Please contact the developer or wait until the extension is fixed. selector1: "#repo-content-turbo-frame div.Box-body table", selector2: "#repo-content-pjax-container div.Box-body table"

nekowasabi avatar Dec 13 '22 08:12 nekowasabi

Reproduce

  1. Install this app.
  2. Open swagger page in GitHub.
  3. Click this app icon.

nekowasabi avatar Dec 13 '22 08:12 nekowasabi

same error

tolluset avatar Jan 12 '23 05:01 tolluset

@nekowasabi, @Tolluset Sorry for the late reply and Thank you for your report! But I can not reproduce the problem now. I have tried all the files listed below.

  • https://github.com/OAI/OpenAPI-Specification/tree/main/examples/v2.0
  • https://github.com/OAI/OpenAPI-Specification/tree/main/examples/v3.0

If you don't mind, could you please elaborate on your situation? For example, the DOM displayed on GitHub seems to change because of the following:

  • Logged in or not
  • Belonging to a GitHub organization or not
  • Occasional AB test

I have written tests for every DOM I know of, but it is not enough...

What I want to know 🙏

  • Are you logged in to GitHub? (Yes/No)
  • Does your account belong to a GitHub organization? (Yes/No)
  • Are you using Chrome's secret mode? (Yes/No)

It would be helpful to know if there are other situations of concern.

arx-8 avatar Jan 16 '23 09:01 arx-8

@arx-8

Are you logged in to GitHub? (Yes/No)

  • yes

Does your account belong to a GitHub organization? (Yes/No)

  • yes

Are you using Chrome's secret mode? (Yes/No)

  • no

I am using refined-gihutb extension (https://github.com/refined-github/refined-github), can this cause problem?

tolluset avatar Jan 17 '23 02:01 tolluset

Same issue:

    Error: Unexpected DOM. Probably GitHub has been updated. Please contact the developer or wait until the extension is fixed. selector1: "#repo-content-turbo-frame div.Box-body table", selector2: "#repo-content-pjax-container div.Box-body table"
    at Em (content_scripts.ts.3ce163c6.js:71:1677)
    at E7e (content_scripts.ts.3ce163c6.js:228:207)
    at x7e (content_scripts.ts.3ce163c6.js:228:139)
    at content_scripts.ts.3ce163c6.js:225:151

@arx-8

Are you logged in to GitHub? (Yes/No)

  • Fails when I am logged in
  • Works when I am signed out!

Does your account belong to a GitHub organization? (Yes/No)

  • No, but I do have an org account. It also fails with same error.

Are you using Chrome's secret mode? (Yes/No)

  • No

Using latest Edge. Ad Blocker disabled.

Update:

  • I opened petstore-expanded.json to Incognito mode, clicked the extension, and nothing happened.
  • I did a hard refresh (ctrl+F5), clicked the extension, and it worked! Now it works all the time in Incognito mode... as long as I am signed out.

When logged out, the content selector is #repo-content-pjax-container > div > div > div.Box.mt-3.position-relative > div.Box-body.p-0.blob-wrapper.data.type-oasv3-json.gist-border-0 > div > table

When logged in, the equivalent content selector is #repo-content-pjax-container > react-app > div > div > div.Box-sc-1gh2r6s-0 > div.Box-sc-1gh2r6s-0.eIXfXs > div > div > main > div.Box-sc-1gh2r6s-0.pBRZy > div > div.Box-sc-1gh2r6s-0.bsCgnj > div.Box-sc-1gh2r6s-0.bUAlhA > div > div.Box-sc-1gh2r6s-0.dwgsHB > section > div. Here is a screenshot: image

mrfootoyou avatar Feb 18 '23 21:02 mrfootoyou