├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── Firefox ├── background.html ├── images │ ├── ico128.png │ ├── ico16.png │ ├── ico32.png │ ├── ico48.png │ └── ico64.png ├── js │ ├── automate.js │ └── tweet.js └── manifest.json ├── LICENSE.md ├── README.md ├── Screenshot_1.png ├── images ├── ico128.png ├── ico16.png ├── ico32.png ├── ico48.png └── ico64.png ├── js ├── automate.js └── service_worker.js └── manifest.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Firefox/background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Firefox/images/ico128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Firefox/images/ico128.png -------------------------------------------------------------------------------- /Firefox/images/ico16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Firefox/images/ico16.png -------------------------------------------------------------------------------- /Firefox/images/ico32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Firefox/images/ico32.png -------------------------------------------------------------------------------- /Firefox/images/ico48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Firefox/images/ico48.png -------------------------------------------------------------------------------- /Firefox/images/ico64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Firefox/images/ico64.png -------------------------------------------------------------------------------- /Firefox/js/automate.js: -------------------------------------------------------------------------------- 1 | // The script only clicks continue if key isn't empty and match pattern to allow users to correct it manually 2 | // as an example for those posted on /r/FreeGameFindings/ or /r/FreeGamesOnSteam/ to avoid bots. 3 | // console.log('automate script injected'); 4 | /* 5 | var _re = new RegExp('^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$','i'); 6 | var _key = document.getElementById('product_key').value; 7 | var _valid = (_key != '') && _re.test(_key); 8 | 9 | // Check SSA Checkbox and Click Continue 10 | var checkSSAExist = setInterval(function CheckSSA() { 11 | const element = document.getElementById('accept_ssa'); 12 | if (element) { 13 | element.checked = true; 14 | clearInterval(checkSSAExist); 15 | if (_valid) { 16 | document.getElementById('register_btn').click(); 17 | } 18 | } 19 | }, 100); // check every 100ms 20 | */ 21 | // End of file; -------------------------------------------------------------------------------- /Firefox/js/tweet.js: -------------------------------------------------------------------------------- 1 | function tweet(info, tab) { 2 | chrome.tabs.create({ 3 | // url: "https://twitter.com/intent/tweet?text=" + info.selectionText.replace(/\s/g, '') 4 | url: "https://twitter.com/intent/tweet?text=" + info.selectionText 5 | }, function (tab) { 6 | chrome.tabs.executeScript(tab.id, { 7 | file: 'js/automate.js' 8 | }); 9 | }); 10 | }; 11 | 12 | chrome.contextMenus.create({ 13 | title: "Tweet: %s", 14 | contexts: ["selection"], 15 | onclick: tweet, 16 | }); 17 | 18 | // End of file; -------------------------------------------------------------------------------- /Firefox/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Tweet from Context Menu", 4 | "description": "Use the right-click menu to tweet selected text", 5 | "version": "0.1", 6 | "content_security_policy": "default-src 'self' ", 7 | "permissions": [ 8 | "contextMenus", 9 | "http://*/", 10 | "https://*/" 11 | ], 12 | "background": { 13 | "scripts": [ 14 | "js/tweet.js" 15 | ], 16 | "persistent": true 17 | }, 18 | "browser_action": { 19 | "default_icon": "images/ico32.png" 20 | }, 21 | "icons": { 22 | "16": "images/ico16.png", 23 | "32": "images/ico32.png", 24 | "48": "images/ico48.png", 25 | "64": "images/ico64.png", 26 | "128": "images/ico128.png" 27 | } 28 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Roman Davydov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Right-Click Twitter 2 | 3 | ![](https://img.shields.io/github/license/rdavydov/RightClickTwitter?style=for-the-badge&logo=github&color=purple&logoColor=thistle) 4 | ![](https://img.shields.io/github/stars/rdavydov/RightClickTwitter?style=for-the-badge&logo=github&color=darkblue&logoColor=aquamarine) 5 | ![](https://img.shields.io/github/forks/rdavydov/RightClickTwitter?style=for-the-badge&logo=github&color=darkblue&logoColor=aquamarine) 6 | ![](https://img.shields.io/github/watchers/rdavydov/RightClickTwitter?style=for-the-badge&logo=github&color=darkblue&logoColor=aquamarine) 7 | ![](https://img.shields.io/github/last-commit/rdavydov/RightClickTwitter?style=for-the-badge&logo=github&color=darkgreen&logoColor=lightgreen) 8 | 9 | ![](https://github.com/rdavydov/RightClickTwitter/blob/master/Screenshot_1.png?raw=true) 10 | 11 | Chrome/Firefox/Opera Extension that allows to select/mark a text and quickly tweet it via Right-Click Context Menu 12 | 13 | Opens the Twitter's new tweet page with the previously selected text inserted in the tweet body. 14 | 15 | ## How to Use 16 | 17 | 1. Select any text on a webpage 18 | 2. Right-Click and select 'Tweet' (with a Twitter icon) 19 | 20 | ## How to Install 21 | 22 | Edge 23 | 24 | - (public v0.1) 25 | 26 | Opera 27 | 28 | - (public v0.1) 29 | 30 | Firefox 31 | 32 | - (public v0.1) 33 | 37 | 38 | OR (Chromium-based browsers) 39 | 40 | 1. Clone this repo 41 | 2. Go to your browser's extensions `chrome://extensions` 42 | 3. Enable Developer mode 43 | 4. Click "Load unpacked" (extension) and select this cloned repo's folder 44 | 45 | ## TODO 46 | 47 | - extension option to autoclick the Tweet button on the opened page 48 | -------------------------------------------------------------------------------- /Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/Screenshot_1.png -------------------------------------------------------------------------------- /images/ico128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/images/ico128.png -------------------------------------------------------------------------------- /images/ico16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/images/ico16.png -------------------------------------------------------------------------------- /images/ico32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/images/ico32.png -------------------------------------------------------------------------------- /images/ico48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/images/ico48.png -------------------------------------------------------------------------------- /images/ico64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdavydov/RightClickTwitter/73e2fc76d10125f100d8138457edac755b59dd8c/images/ico64.png -------------------------------------------------------------------------------- /js/automate.js: -------------------------------------------------------------------------------- 1 | // The script only clicks continue if key isn't empty and match pattern to allow users to correct it manually 2 | // as an example for those posted on /r/FreeGameFindings/ or /r/FreeGamesOnSteam/ to avoid bots. 3 | // console.log('automate script injected'); 4 | /* 5 | var _re = new RegExp('^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$','i'); 6 | var _key = document.getElementById('product_key').value; 7 | var _valid = (_key != '') && _re.test(_key); 8 | 9 | // Check SSA Checkbox and Click Continue 10 | var checkSSAExist = setInterval(function CheckSSA() { 11 | const element = document.getElementById('accept_ssa'); 12 | if (element) { 13 | element.checked = true; 14 | clearInterval(checkSSAExist); 15 | if (_valid) { 16 | document.getElementById('register_btn').click(); 17 | } 18 | } 19 | }, 100); // check every 100ms 20 | */ 21 | // End of file; -------------------------------------------------------------------------------- /js/service_worker.js: -------------------------------------------------------------------------------- 1 | /* TODO: 2 | - extension option to autoclick the Tweet button on the opened page 3 | */ 4 | 5 | function tweet(info, tab) { 6 | chrome.tabs.create({ 7 | // url: "https://twitter.com/intent/tweet?text=" + info.selectionText.replace(/\s/g, '') 8 | url: "https://twitter.com/intent/tweet?text=" + info.selectionText 9 | }, function (tab) { 10 | chrome.scripting.executeScript({ 11 | target: { 12 | tabId: tab.id 13 | }, 14 | world: chrome.scripting.ExecutionWorld.MAIN, 15 | files: ['js/automate.js'] 16 | }); 17 | }); 18 | }; 19 | 20 | chrome.contextMenus.removeAll(function () { 21 | chrome.contextMenus.create({ 22 | id: "tweet", 23 | title: "Tweet: %s", 24 | contexts: ["selection"] 25 | }); 26 | }); 27 | 28 | chrome.contextMenus.onClicked.addListener(function (info, tab) { 29 | if (info.menuItemId == "tweet") { 30 | tweet(info, tab); 31 | } 32 | }); 33 | 34 | // End of file; -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | // "update_url": "https://clients2.google.com/service/update2/crx", 3 | "manifest_version": 3, 4 | "name": "Tweet from Context Menu", 5 | "description": "Use the right-click menu to tweet selected text", 6 | "version": "0.1", 7 | "permissions": [ 8 | "contextMenus", 9 | "scripting" 10 | ], 11 | "background": { 12 | "service_worker": "js/service_worker.js" 13 | }, 14 | "minimum_chrome_version": "88", 15 | "icons": { 16 | "16": "images/ico16.png", 17 | "32": "images/ico32.png", 18 | "48": "images/ico48.png", 19 | "64": "images/ico64.png", 20 | "128": "images/ico128.png" 21 | }, 22 | "action": { 23 | "default_icon": "images/ico32.png" 24 | }, 25 | "content_security_policy": {}, 26 | "host_permissions": [ 27 | "http://*/", 28 | "https://*/" 29 | ] 30 | } --------------------------------------------------------------------------------