├── src ├── bg │ └── background.js └── inject │ ├── inject.css │ └── inject.js ├── _locales └── en │ └── messages.json ├── preview.jpg ├── icons ├── icon128.png ├── icon16.png ├── icon19.png └── icon48.png ├── README.md └── manifest.json /src/bg/background.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fladson/move-close-pr-button/HEAD/preview.jpg -------------------------------------------------------------------------------- /icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fladson/move-close-pr-button/HEAD/icons/icon128.png -------------------------------------------------------------------------------- /icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fladson/move-close-pr-button/HEAD/icons/icon16.png -------------------------------------------------------------------------------- /icons/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fladson/move-close-pr-button/HEAD/icons/icon19.png -------------------------------------------------------------------------------- /icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fladson/move-close-pr-button/HEAD/icons/icon48.png -------------------------------------------------------------------------------- /src/inject/inject.css: -------------------------------------------------------------------------------- 1 | button.btn.js-comment-and-button{ 2 | margin-top: 15px; 3 | width: 100%; 4 | } 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github move close PR button 2 | ![preview](preview.jpg) 3 | 4 | Why? Have you never misclicked the `Close pull request` button when posting PR comments? :grin: 5 | 6 | ## Install 7 | 8 | Download as zip and load it on Chrome 9 | -------------------------------------------------------------------------------- /src/inject/inject.js: -------------------------------------------------------------------------------- 1 | chrome.extension.sendMessage({}, function(response) { 2 | var readyStateCheckInterval = setInterval(function() { 3 | if (document.readyState === "complete") { 4 | clearInterval(readyStateCheckInterval); 5 | document.getElementById('partial-discussion-sidebar').appendChild(document.getElementsByName('comment_and_close')[0]); 6 | } 7 | }, 10); 8 | }); 9 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Github move close PR button", 3 | "version": "0.0.1", 4 | "manifest_version": 2, 5 | "description": "Moves the close PR button to the sidebar to prevent closing PRs by misclick", 6 | "homepage_url": "https://github.com/fladson/move-close-pr-button", 7 | "icons": { 8 | "16": "icons/icon16.png", 9 | "48": "icons/icon48.png", 10 | "128": "icons/icon128.png" 11 | }, 12 | "default_locale": "en", 13 | "background": { 14 | "scripts": [ 15 | "src/bg/background.js" 16 | ] 17 | }, 18 | "permissions": [ 19 | "*://github.com/*", 20 | "webNavigation" 21 | ], 22 | "content_scripts": [ 23 | { 24 | "matches": [ 25 | "https://github.com/*" 26 | ], 27 | "css": [ 28 | "src/inject/inject.css" 29 | ] 30 | }, 31 | { 32 | "matches": [ 33 | "https://github.com/*" 34 | ], 35 | "js": [ 36 | "src/inject/inject.js" 37 | ] 38 | } 39 | ] 40 | } 41 | --------------------------------------------------------------------------------