-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Disable URL hash encoding or whitelist some symbols to make VueRouter work fine with Telegram WebApps #2155
Comments
It's interesting they parse the URL like this. I would consider this a Telegram bug because you are not supposed to encode the |
Sorry, I didn't provide full request. They are not encoding all the = characters. Only for some parts of the URL. Here is full hash: Before: After VueRouter's encoding So you have a better understanding what TG does. |
What problem is this solving
I am building a Telegram WebApp with Nuxt and I am faced with an issue. When you open the app in Telegram, telegram adds special params to the URL so the app can communicate with TG. These params are added as website hash and the URL of the webapp looks like this
https://yourapp.com/#tgWebAppData=query_id%3DAAGZbY...
But after I refresh the WebApp in Telegram the URL becomes like this:
https://yourapp.com/#tgWebAppData=query_id=AAGZbY...
The hash param in the URL gets encoded and this completely breaks the connection between the app and TG because now Telegram WebApp JS file https://telegram.org/js/telegram-web-app.js can’t read the params correctly.
How can I disable URL encoding for symbols like %3D and some others to make the WebApp work correctly? It’s a serious issue because Telegram WebApps are becoming more popular. It would be great if we could whitelist some symbols we want. Flexibility is always great.
Proposed solution
Disable URL hash encoding completely
Or add the ability/option to whitelist some symbols so they are not encoded.
Or allow developers to change encoding rules for URLs.
This will make VueRouter work fine with Telegram WebApps.
Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: