Closed svan-b closed 6 days 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
@adamlui
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
@adamlui
Correct
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
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
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
Can you take a screenshot like for the old one it is
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
@rajnikyadav what's that a virus
@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
This one does, but so do a few other lines
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
Here you go. For now I must go, I can help debug tomorrow. Thanks
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
same issue and same test result
@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
@adamlui how should I do,now I'm in this page
@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
yes, it's amazing that after I flash the web page , the button show again, I think this is what you want :)
and the button appears and it works, very happy I can use this again :smiley:
That's my button, can you inspect OpenAI's button (they copied it from me when I first released this extension)
I‘ve copyed the outerHTML on the comment, but it dosen't show, I screenshot for you
Do you have a button in the sidebar fro OpenAI? Your paste is my button, also I thought my buttons don't show?
sure can, this is the inspection OpenAI's button html
Ok can you click the triangle, then the first <path d=""
I need to see the d=""
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
yes, looks like this
Oh it moved then, can you paste the surrounding code
It used to be here
Can you patse something similar showing all the ancesotrs up to <body>
is this OK? I need to do some work now, thanks for answering me :)
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?
@adamlui yes,when I type sidebar.toggle()
, the siderbar show or hide successfully :)
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
Hi @adamlui, any luck here? I should probably try and remove it and install it again to see.
@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?
Not working at the moment
@svan-b can you raise the console so I can see the errors
here sorry
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
No problem, thanks for your attention
hey @svan-b did you update
Hi @adamlui sorry for the delay, yes it works fine thank you
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.