Sharing "locationHref" to Telegram
See original GitHub issueHi, I know this is a very specific request but is it possible to add an option to get window.location.href
.
For example instead of:
tg://msg_url?url={searchTerms}
it will be
tg://msg_url?url={locationHref}
For now I use tg://msg_url?url={searchTerms}
and paste URL into input field myself and it works but getting locationHref as variable would be great.
Another use case for this could be opening URL with a proxy, for example
https://proxy.duckduckgo.com/iu/?u=https://i.imgur.com/AD3MbBi.jpg
It’s still very specific 😃 but it would be great if you consider.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Share a link via URL scheme to Telegram - Stack Overflow
Always use the NEW way: https://t.me because it will open the Telegram DESKTOP app in Windows\Linux\Mac IF THE USER WANTS\HAS it, otherwise it ......
Read more >Sharing Button - Telegram APIs
A Telegram Sharing Button is an easy way to let users forward content from your website or app to their friends, Channels or...
Read more >How to create links to phone, WhatsApp, Telegram, Skype etc.
1. Link to open a chat · 2. Link to open a chat and send a message: · 3. Share the text.
Read more >How to Easily Add Share Links for Each Social Media Platform
In this tutorial, we'll go over how we can add a share link for each social media platform directly in our HTML.
Read more >How to Copy Telegram Profile, Group, Channel, Message Links
1. Open the Telegram app and go to the channel whose public link you want to copy and share with others. Tap on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad I could help. 😃
Regex is very useful in some situations, though it can be hard to visually parse! The rules are mostly simple, however. I think it’s a useful skill. 😃
Hey @mortyobnoxious, in version 3.41.1 (just updated) I added support for modifications on the URL variables. In general, you can use {href{replace_this|with_this}}, but URLs like
https://twitter.com/BernieSanders/status/1233962400556122112
are different every time, so we need to use regular expressions (not sure if you are familiar with those at all) to try and remove everything that is not the number/ID.So to filter out
1233962400556122112
from an href likehttps://twitter.com/BernieSanders/status/1233962400556122112
you could use (sorry, this is ugly xD):In practice:
However, if the username “BernieSanders” was “B3rni3S4nd3rs”, you’d get _3343_1233962400556122112, so we need something better (i.e. even uglier) like this:
It basically matches all possible characters with
.+
, then/status/
, then a sequence of digits with\d+
, and then finally anything irrelevant that might come after in the URL with.+
again. Then it replaces ALL of that with just the thing we placed in parenthesis, which is the number given by(\d+)
.