Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed getting token and author id #439

Merged
merged 3 commits into from
Jul 4, 2023
Merged

Conversation

titushm
Copy link
Contributor

@titushm titushm commented Jan 20, 2023

No description provided.

@abigailwillow
Copy link
Contributor

Hi! Thanks for your PR! I've noticed you've opened 3 PRs over the last 6 hours. Is there anything you need help with regarding your PRs? This one looks like a good improvement over the other two. I also wanted to let you know that the author of this repository is currently not very active and it might take a while to have your PR merged!

@titushm
Copy link
Contributor Author

titushm commented Jan 20, 2023

Hi, yea you can ignore the previous two, I found issues with my method every time after I had sent a pr. I believe this should be final and wont need any more tweaking. anyway thanks for the reply!

@abigailwillow
Copy link
Contributor

abigailwillow commented Jan 20, 2023

For future reference, it's not necessary to close and open new PRs. You can rebase commits to "undo", "redo", or edit commits that you've already pushed. Most users prefer PRs with few commits so this can be useful to squash multiple commits into one as well.

Also check out GitLens, it provides some nice visual tools for working with Git within Visual Studio Code. If you use a different code editor I'm sure there's similar extensions available.

Hope this helps!

@victornpb
Copy link
Owner

Hi, can you explain what this code does? I just tested the current implementation, and it is not broken. It's been reliable for quite some time.

@Aida-Enna
Copy link

+1 for current code working

@victornpb victornpb added the PR looks good Looks like it's good for merging (maybe be in the next release) label Mar 5, 2023
@victornpb
Copy link
Owner

I tested this and it works, I will keep this in case the current implementation stops working.

@titushm
Copy link
Contributor Author

titushm commented Mar 5, 2023

I'm not sure exactly when it causes the error but I think if you open up Dev tools and look at the localstorage then it seems to hide the token from the localstorage

@titushm
Copy link
Contributor Author

titushm commented Mar 5, 2023

I will test later

@victornpb
Copy link
Owner

I'm not sure exactly when it causes the error but I think if you open up Dev tools and look at the localstorage then it seems to hide the token from the localstorage

Yes, that's right, my implementation fails if you open devTools. It seems that they recently added code to prevent people from running scripts directly in the console which makes sense.

I'm not entirely sure how they are able to detect devTools open TBH, but even tho it's kinda annoying when I'm trying to debug undiscord, I think its better to keep as is because the chance of it stopping working is smaller.

your method of injecting a module in the webpack runtime is clever ngl.

@titushm
Copy link
Contributor Author

titushm commented Mar 7, 2023

Does it detect the size of the discord window?
If you set devtools to be a separate window can it still detect it?

@victornpb
Copy link
Owner

Does it detect the size of the discord window? If you set devtools to be a separate window can it still detect it?

Yes, you are correct, it works if you detach the devTools window.

So they are probably doing something like:

// on window resize
isDevToolsOpen = ((window.outerWidth - window.innerWidth) + (window.outerHeight - window.innerHeight)) > 500;
    
if (isDevToolsOpen) delete localStorage;

@TheRedstoneRadiant
Copy link

Can this please be merged?

I use the copy/paste version very often and have to manually get the token via network requests each time.

@titushm
Copy link
Contributor Author

titushm commented Jun 23, 2023

Can this please be merged?

I use the copy/paste version very often and have to manually get the token via network requests each time.

It was merged at one point but was reverted as to maintain parity with getting the user id / not enough people had an issue with the old system

@titushm
Copy link
Contributor Author

titushm commented Jun 23, 2023

I have the working version on my GitHub https://github.com/titushm/undiscord-patched

@titushm titushm closed this Jun 23, 2023
@titushm titushm force-pushed the patch-1 branch 2 times, most recently from 792dd28 to a9ce537 Compare June 23, 2023 15:40
@titushm titushm reopened this Jun 23, 2023
@titushm
Copy link
Contributor Author

titushm commented Jun 23, 2023

@victornpb i have rewritten my pull request to use webpack as a fallback method if the auth token cannot be found in localstorage

@AreaZR
Copy link

AreaZR commented Jul 2, 2023

Any updates on this?

@titushm
Copy link
Contributor Author

titushm commented Jul 2, 2023

Any updates on this?

The owner of this repo is not very active so might take a while if a pull request was to happen

@victornpb victornpb merged commit 3151c8c into victornpb:master Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR looks good Looks like it's good for merging (maybe be in the next release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants