arx-8 / swagger-viewer

Chrome Extension for Swagger-UI
https://chrome.google.com/webstore/detail/swagger-viewer/nfmkaonpdmaglhjjlggfhlndofdldfag
Apache License 2.0
59 stars 14 forks source link

Error in event handler: Error: Unexpected DOM. selector: "div.repository-content > div.Box > div.Box-body > table #46

Closed shkomine closed 3 years ago

shkomine commented 3 years ago

@arx-8 いつもありがたく使わせて頂いています。 以下のエラーが発生しましたので、報告させていただきます。 (issueが日本語だったので、日本語で失礼します。)

本日、Github上で利用したところ以下のエラーが発生してViewの生成に失敗しました。 おそらく、GithubのDOMに変更があったのだと思いますが、対応よろしくお願いします。

Version

1.2.1

Error message

Error in event handler: Error: Unexpected DOM. selector: "div.repository-content > div.Box > div.Box-body > table"

arx-8 commented 3 years ago

@shkomine ご報告ありがとうございます!

昨日、修正 (https://github.com/arx-8/swagger-viewer/pull/44) 、及び、Chrome webstore へのアップロードは完了し、 今 Chrome webstore の「審査待ち」の状態です。

まもなく修正版の 2.0.0 が配信されるかと思いますので、今しばらくお待ちください。 ご不便お掛けし申し訳ございません。

shkomine commented 3 years ago

@arx-8 早速のご対応ありがとうございます。 2.0.0 の反映、楽しみにしてます!

courtney-arnold commented 3 years ago

@arx-8 I am having this problem as well. It appears that Github added an additional div into the hierarchy. It is no longer div.repository-content > div.Box > div.Box-body > table It is now div.repository-content > div > div.Box > div.Box-body > table

shipleyr commented 3 years ago

Any ideas on timelines to resolve this issue?

courtney-arnold commented 3 years ago

@shipleyr If you don't want to wait, you can do what I have done in the meantime. I added the tampermonkey chrome extension to my browser and then created the following script, which will remove that additional div that is causing the headache. As a note, Github is a single page application, so you will have to refresh the page with the .yaml on it, in order for the script to run. Since the script only runs upon load of the page.

// ==UserScript==
// @name         Github Swagger Fix
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://github.com/*.yaml
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var parentDiv = document.querySelector("div.repository-content");
    var childDiv = document.querySelector("div.repository-content > div");

    while ( childDiv.hasChildNodes()){
        parentDiv.appendChild(childDiv.firstChild);
    }
})();
cm-kazup0n commented 3 years ago

2.0.0 is now available in the store. But I couldn't install the extension.

image

Here's my env Chrome version: 88.0.4324.150(Official Build) (x86_64) macOS: 10.15.7

arx-8 commented 3 years ago

@cm-kazup0n Thank you for your report!

I have just published version 2.0.1. It should work this time.


I apologize for any inconvenience for a long time. And Thank you for all the reports!