adamlui / chatgpt-apps

🤖 Apps that utilize the astounding power of ChatGPT or enhance its UX
Other
330 stars 31 forks source link

Issue with chat gpt update? #75

Closed svan-b closed 6 days ago

svan-b commented 2 weeks ago

Hi Adam, love your extension; however, today I am no longer able to use the extension. I have added and removed it multiple times and still no luck.

image
adamlui commented 2 weeks ago

Hey @svan-b you are the 2nd person to say this, but it still works for me, can you show the console (Ctrl+Shift+J in Chrome, Ctrl+Shift+K in Firefox) so I can see possible errors

svan-b commented 2 weeks ago

@adamlui image

adamlui commented 2 weeks ago

Ok it looks like they updated the sidebar for you, in console can you paste this

document.querySelector('#__next > div > div')

and confirm it returns null

svan-b commented 2 weeks ago

@adamlui

Correct

image
adamlui commented 2 weeks ago

It looks there is no more sidebar? Can you get the sidebar to appear? If so, can you right-click on it and Inspect Element so I can see the code for it

adamlui commented 2 weeks ago

Oh I see you still have sidebar since i see the scrollbar for it, I just need to know how it got updated so I can correct the selector

svan-b commented 2 weeks ago

Sidebar is there

body > div.relative.flex.h-full.w-full.overflow-hidden.transition-colors.z-0 > div.flex-shrink-0.overflow-x-hidden.bg-token-sidebar-surface-primary > div > div > div > nav > div.flex-col.flex-1.transition-opacity.duration-500.relative.-mr-2.pr-2.overflow-y-auto

adamlui commented 2 weeks ago

Can you take a screenshot like for the old one it is

image

So when you right-click > inspect it, that line of code should highlight in your sccreenshot, and include all the way up to <body> like this shot

svan-b commented 2 weeks ago
image
adamlui commented 2 weeks ago

@rajnikyadav what's that a virus

adamlui commented 2 weeks ago

@svan-b ignore the spammers, actually can you open Console then keep toggling the sidebar on and off, do you see a line that changes, can you screenshot that line

svan-b commented 2 weeks ago

This one does, but so do a few other lines

image
svan-b commented 2 weeks ago
image
adamlui commented 2 weeks ago

Ok @svan-b can you paste this in the console and hit Enter


const sidebar = {
    hide: function() { this.isOn() ? this.toggle() : console.info('Sidebar already hidden!'); },
    show: function() { this.isOff() ? this.toggle() : console.info('Sidebar already shown!'); },
    isOff: function() { return !this.isOn(); },
    isOn: function() {
        const sidebar = document.querySelector('body script + div > div');
        return sidebar.style.visibility != 'hidden' && sidebar.style.width != '0px';
    },

    toggle: function() {
        const navBtnSelector = 'nav button',
              isToggleBtn = btn => btn.querySelectorAll('svg path[d*="M8.857 3h6.286c1.084"]').length > 0;
        for (const btn of document.querySelectorAll(navBtnSelector))
            if (isToggleBtn(btn)) { btn.click(); return; }
    }
}

Then test each of these functions by typing it and pressing Enter, one at a time, and tell me if they all work

sidebar.hide() - should hide sidebar sidebar.show() - should show sidebar sidebar.isOff() - should return true if off, false if on sidebar.isOn() - should return false if off, true if on sidebar.toggle() - shuld hide sidebar if on, show sidebar if off

svan-b commented 2 weeks ago

Here you go. For now I must go, I can help debug tomorrow. Thanks

image
adamlui commented 2 weeks ago

Ok it looks like detection works but toggling doesn't, tomorrow if you could inspect the sidebar toggle button then I can update the SVG selector too

Jeff-Zzh commented 2 weeks ago

same issue and same test result

adamlui commented 2 weeks ago

@Jeff-Zzh can you inspect the toggle button element so I can update the SVG path selector. The first two groups of the d="" should be something like M8.857 3h6.286c1.084

Jeff-Zzh commented 2 weeks ago

@adamlui how should I do,now I'm in this page image

adamlui commented 2 weeks ago

@Jeff-Zzh is there a ChatGPT button to hide the sidebar? If so, right-click it > left-click inspect, then right-click the line beginning <svg then left-click Copy outer HTML then paste here

Jeff-Zzh commented 2 weeks ago

yes, it's amazing that after I flash the web page , the button show again, image image I think this is what you want :)

and the button appears and it works, very happy I can use this again :smiley:

Jeff-Zzh commented 2 weeks ago
Jeff-Zzh commented 2 weeks ago
adamlui commented 2 weeks ago

That's my button, can you inspect OpenAI's button (they copied it from me when I first released this extension)

image

Jeff-Zzh commented 2 weeks ago

I‘ve copyed the outerHTML on the comment, but it dosen't show, I screenshot for you image

adamlui commented 2 weeks ago

Do you have a button in the sidebar fro OpenAI? Your paste is my button, also I thought my buttons don't show?

Jeff-Zzh commented 2 weeks ago

sure can, this is the inspection OpenAI's button html image

adamlui commented 2 weeks ago

Ok can you click the triangle, then the first <path d="" I need to see the d=""

Jeff-Zzh commented 2 weeks ago

I have also refreshed web page many times before, your button still does not show, but the last time I refreshed it, the buttons showed up

Jeff-Zzh commented 2 weeks ago

image yes, looks like this

adamlui commented 2 weeks ago

Oh it moved then, can you paste the surrounding code

adamlui commented 2 weeks ago

It used to be here

image

Can you patse something similar showing all the ancesotrs up to <body>

Jeff-Zzh commented 2 weeks ago

image image is this OK? I need to do some work now, thanks for answering me :)

adamlui commented 2 weeks ago

Yes but can you try pasting this again


const sidebar = {
    hide: function() { this.isOn() ? this.toggle() : console.info('Sidebar already hidden!'); },
    show: function() { this.isOff() ? this.toggle() : console.info('Sidebar already shown!'); },
    isOff: function() { return !this.isOn(); },
    isOn: function() {
        const sidebar = document.querySelector('body script + div > div');
        return sidebar.style.visibility != 'hidden' && sidebar.style.width != '0px';
    },

    toggle: function() {
        const navBtnSelector = 'nav button',
              isToggleBtn = btn => btn.querySelector('svg path[d*="M8.857 3h6.286c1.084"]');
        for (const btn of document.querySelectorAll(navBtnSelector))
            if (isToggleBtn(btn)) { btn.click(); return; }
    }
}

When you type sidebar.toggle() > Enter , does the sidebar show and hide?

Jeff-Zzh commented 2 weeks ago

@adamlui yes,when I type sidebar.toggle(), the siderbar show or hide successfully :)

adamlui commented 2 weeks ago

Ok I updated chatgpt.js accordingly, now I am bumping it in the million apps that use it, then I will publish to Chrome store and it should auto-update sometime today

svan-b commented 2 weeks ago

Hi @adamlui, any luck here? I should probably try and remove it and install it again to see.

adamlui commented 2 weeks ago

@svan-b yes if you don't have version 2024.2.28 can you re-install or click update all extensions. Does it not work? Can you show the console?

svan-b commented 2 weeks ago

Not working at the moment

image
adamlui commented 2 weeks ago

@svan-b can you raise the console so I can see the errors

svan-b commented 2 weeks ago

here sorry

image
adamlui commented 2 weeks ago

Thank you @svan-b , I have to fix some stuff w/ minify.js, then chatgpt.js, then Widescreen can be fixed, then published again so it will take a while and if you can be patient he fixing auto-update will probably be tomorrow instead

svan-b commented 2 weeks ago

No problem, thanks for your attention

adamlui commented 1 week ago

hey @svan-b did you update

svan-b commented 6 days ago

Hi @adamlui sorry for the delay, yes it works fine thank you