A Chrome extension that allows you to instantly share the current webpage to your Telegram channel or chat with an optional caption.
- One-click sharing - Share any webpage to Telegram instantly
- Custom captions - Add personalized captions to your shared links
- Query parameter preservation - Preserves important URL parameters while removing fragments
- Secure credential storage - Bot tokens are encrypted before storage
- Bot token testing - Verify your Telegram bot credentials before use
- Channel support - Works with both public and private Telegram channels
- Modern UI - Clean, intuitive interface with real-time feedback
- Open Telegram and message @BotFather
- Send
/newbotand follow the instructions - Save your bot token (looks like
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11)
- Add your bot to your target channel as an administrator
- Get your channel ID:
- Public channels: Use
@channelname(e.g.,@mychannel) - Private channels: Use the numeric ID (e.g.,
-1001234567890)
- Public channels: Use
# Clone and build
git clone <repository-url>
cd telegram-snapshare
npm install
./build.sh
# Load in Chrome
1. Open chrome://extensions/
2. Enable "Developer mode"
3. Click "Load unpacked"
4. Select the telegram-snapshare folder- Click the extension icon
- Go to Settings tab
- Enter your Bot Token and Chat ID
- Click Test Bot Token to verify
- Click Save Credentials
- Navigate to any webpage you want to share
- Click the Telegram SnapShare extension icon
- Add a caption (optional) in the text area
- Click "Share to Telegram"
The extension will automatically process the URL (preserving query parameters) and send it to your configured Telegram channel!
- Bot tokens are encrypted using base64 encoding with salt before storage
- Provides basic obfuscation to protect sensitive credentials
- Backward compatible with existing unencrypted tokens
- Uses Chrome's
chrome.storage.syncAPI for secure credential storage - Data is synchronized across Chrome instances securely
- Only accessible by the extension itself
- Query Parameters: Now preserved to maintain functionality of shared links
- Fragments Removed: Hash fragments (#section) are removed for cleaner sharing
- Malicious URL Protection: Basic URL validation and error handling
- No data collection or external analytics
- All communication happens directly between your browser and Telegram
- Minimal required permissions
// Before: https://example.com/page?utm_source=social&ref=twitter#section1
// After: https://example.com/page?utm_source=social&ref=twitter
function processUrl(url) {
const urlObj = new URL(url);
// Preserves: protocol, host, pathname, search (query parameters)
// Removes: hash fragments (for cleaner sharing)
return `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}${urlObj.search}`;
}// Bot Token Encryption (Basic Obfuscation)
function encryptToken(token) {
const salt = 'telegram-snapshare-v1';
return btoa(salt + '|' + token); // Base64 encoding with salt
}
function decryptToken(encrypted) {
const decoded = atob(encrypted);
// Validates salt and extracts original token
return decoded.substring(salt.length + 1);
}{
"telegramBotToken": "dGVsZWdyYW0tc25hcHNoYXJlLXYxfDEyMzQ1Njo...", // Encrypted
"telegramChatId": "@mychannel" // Plain text (not sensitive)
}