├── .DS_Store ├── .gitignore ├── README.md ├── TamperData.zip ├── _config.yml ├── background └── td.js ├── icons ├── icon-notamper-16.png ├── icon-notamper-32.png ├── icon-notamper-48.png ├── icon-tamper-16.png ├── icon-tamper-32.png └── icon-tamper-48.png ├── images ├── logo-notamper.png └── logo-tamper.png ├── manifest.json └── popups ├── confirm_tamper ├── popup.html ├── popup.js ├── style.css └── styles.css ├── tamper_body ├── popup.html ├── popup.js └── style.css └── tamper_headers ├── popup.html ├── popup.js └── style.css /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/ 2 | */.DS_store 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 | 6 | 7 | ## Tamper Data for FF Quantum 8 | 9 |

10 | 11 | The original Tamper Data no longer works in FF 57+. 12 | 13 | This is a re-write that works in FF 57+, however, the webRequest API doesn't currently support changing request body parameters. There are tickets open for both [Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1491087) and [Chrome](https://bugs.chromium.org/p/chromium/issues/detail?id=91191) so hopefully it will be resolved sooner than later, but for now this is still very useful for other things: 14 | 15 | - Monitoring live requests 16 | - Editing headers on live requests 17 | - Canceling live requests 18 | - Redirecting live requests 19 | 20 | ### Installing from source (Development) 21 | 22 | 1) Download and unpack the source code. 23 | 2) Navigate to [about:debugging](about:debugging). 24 | 3) Click the button to add a temporary extention. 25 | 4) Select the manifest.json file and hit OK. 26 | 27 | It will automatically uninstall when you close the browser. 28 | 29 | ### Install from the Official Add-ons Page 30 | 31 | You can install from the official add-ons page here, [here](https://addons.mozilla.org/firefox/addon/tamper-data-for-ff-quantum/). 32 | 33 | ### Usage 34 | 35 | Once installed you will see a blue cloud button in the toolbar, to the left of the URL bar. Click that to start tampering. 36 | -------------------------------------------------------------------------------- /TamperData.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/TamperData.zip -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile -------------------------------------------------------------------------------- /background/td.js: -------------------------------------------------------------------------------- 1 | 2 | var isTampering = false; 3 | var windowopen = false; 4 | var types = []; 5 | var pattern = false; 6 | var tabId = browser.tabs.TAB_ID_NONE; 7 | 8 | var msgHandler = ()=>{}; 9 | function handleMessage(msg){ 10 | msgHandler(msg); 11 | } 12 | 13 | function tamper_header_listener(e) { 14 | if((e.originUrl || "").indexOf("moz-extension://") === 0) return e; 15 | if(!~types.indexOf(e.type)) return e; 16 | if(pattern && null === e.url.match(RegExp(pattern, "g"))) return e; 17 | return new Promise(done=>{ 18 | var data = { 19 | method: e.method, 20 | url: e.url, 21 | type: e.type, 22 | headers: [] 23 | }; 24 | e.requestHeaders.forEach(function (header) { 25 | data.headers.push({ 26 | name: header.name, 27 | value: header.value 28 | }); 29 | }); 30 | user_modify_headers(data).then(res=>{ 31 | if(res.stop) stop_tampering(); 32 | done({requestHeaders: res.headers}); 33 | }); 34 | }); 35 | } 36 | 37 | function tamper_request_listener(e){ 38 | if((e.originUrl || "").indexOf("moz-extension://") === 0) return e; 39 | if(!~types.indexOf(e.type)) return e; 40 | if(pattern && null === e.url.match(RegExp(pattern, "g"))) return e; 41 | return new Promise(done=>{ 42 | var body = []; 43 | if(e.requestBody && e.requestBody.formData){ 44 | for(var n in e.requestBody.formData){ 45 | if(e.requestBody.formData.hasOwnProperty(n)) body.push({name: n, value: e.requestBody.formData[n][0]}); 46 | } 47 | } 48 | var data = { 49 | method: e.method, 50 | url: e.url, 51 | type: e.type, 52 | body: body 53 | }; 54 | user_modify_body(data).then(res=>{ 55 | if(res.stop) stop_tampering(); 56 | if(res.cancel) return done({cancel: true}); 57 | if(res.redirect) return done({redirectUrl: res.redirect}); 58 | done(e); 59 | }); 60 | }); 61 | } 62 | 63 | function stop_tamper_listener(){ 64 | var listening = browser.webRequest.onBeforeSendHeaders.hasListener(tamper_header_listener); 65 | if(listening){ 66 | browser.webRequest.onBeforeSendHeaders.removeListener(tamper_header_listener); 67 | browser.webRequest.onBeforeRequest.removeListener(tamper_request_listener); 68 | } 69 | } 70 | 71 | function start_tamper_listener(){ 72 | const filters = {urls: [""]}; 73 | if (tabId !== browser.tabs.TAB_ID_NONE) 74 | filters.tabId = tabId; 75 | 76 | browser.webRequest.onBeforeSendHeaders.addListener( 77 | tamper_header_listener, 78 | filters, 79 | ["blocking", "requestHeaders"] 80 | ); 81 | browser.webRequest.onBeforeRequest.addListener( 82 | tamper_request_listener, 83 | filters, 84 | ["blocking", "requestBody"] 85 | ); 86 | } 87 | 88 | function user_confirm_tamper(tab_id){ 89 | return new Promise(done=>{ 90 | browser.windows.create({ 91 | url: "popups/confirm_tamper/popup.html?"+encodeURIComponent(JSON.stringify({ 92 | types: types, 93 | pattern: pattern, 94 | tab: tabId !== browser.tabs.TAB_ID_NONE, 95 | })), 96 | type: "panel", 97 | width: 1200, 98 | height: 800, 99 | allowScriptsToClose: true 100 | }).then(w=>{ 101 | msgHandler = msg=>{ 102 | types = msg.types; 103 | pattern = msg.pattern; 104 | tabId = msg.tab ? tab_id : browser.tabs.TAB_ID_NONE; 105 | browser.windows.getCurrent().then(wi=>{ 106 | browser.windows.remove(wi.id); 107 | done(msg); 108 | }); 109 | }; 110 | }); 111 | }); 112 | } 113 | 114 | function user_modify_headers(data){ 115 | return new Promise(done=>{ 116 | browser.windows.create({ 117 | url: "popups/tamper_headers/popup.html?"+encodeURIComponent(JSON.stringify(data)), 118 | type: "panel", 119 | width: 375, 120 | height: 525, 121 | allowScriptsToClose: true 122 | }).then(w=>{ 123 | msgHandler = msg=>{ 124 | browser.windows.getCurrent().then(wi=>{ 125 | browser.windows.remove(wi.id); 126 | done(msg); 127 | }); 128 | }; 129 | }); 130 | }); 131 | } 132 | 133 | function user_modify_body(data){ 134 | return new Promise(done=>{ 135 | browser.windows.create({ 136 | url: "popups/tamper_body/popup.html?"+encodeURIComponent(JSON.stringify(data)), 137 | type: "panel", 138 | width: 375, 139 | height: 525, 140 | allowScriptsToClose: true 141 | }).then(w=>{ 142 | msgHandler = msg=>{ 143 | browser.windows.getCurrent().then(wi=>{ 144 | browser.windows.remove(wi.id); 145 | done(msg); 146 | }); 147 | }; 148 | }); 149 | }); 150 | } 151 | 152 | function confirm_and_start_tamper(tab_id){ 153 | user_confirm_tamper(tab_id).then(res=>{ 154 | if(res.tamper === true){ 155 | isTampering = true; 156 | browser.browserAction.setIcon({ 157 | path: { 158 | "48": "icons/icon-tamper-48.png", 159 | "32": "icons/icon-tamper-32.png", 160 | "16": "icons/icon-tamper-16.png" 161 | } 162 | }); 163 | start_tamper_listener(); 164 | } 165 | }); 166 | } 167 | 168 | function stop_tampering(){ 169 | isTampering = false; 170 | browser.browserAction.setIcon({ 171 | path: { 172 | "48": "icons/icon-notamper-48.png", 173 | "32": "icons/icon-notamper-32.png", 174 | "16": "icons/icon-notamper-16.png" 175 | } 176 | }); 177 | stop_tamper_listener(); 178 | } 179 | 180 | browser.runtime.onMessage.addListener(handleMessage); 181 | browser.browserAction.onClicked.addListener((tab)=>{ 182 | if(!isTampering) confirm_and_start_tamper(tab.id); 183 | else stop_tampering(); 184 | }); 185 | -------------------------------------------------------------------------------- /icons/icon-notamper-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-notamper-16.png -------------------------------------------------------------------------------- /icons/icon-notamper-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-notamper-32.png -------------------------------------------------------------------------------- /icons/icon-notamper-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-notamper-48.png -------------------------------------------------------------------------------- /icons/icon-tamper-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-tamper-16.png -------------------------------------------------------------------------------- /icons/icon-tamper-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-tamper-32.png -------------------------------------------------------------------------------- /icons/icon-tamper-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/icons/icon-tamper-48.png -------------------------------------------------------------------------------- /images/logo-notamper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/images/logo-notamper.png -------------------------------------------------------------------------------- /images/logo-tamper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/images/logo-tamper.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "description": "Tamper Data for FF Quantum.", 4 | "manifest_version": 2, 5 | "name": "Tamper Data for FF Quantum", 6 | "author": "Pamblam", 7 | "version": "0.5", 8 | "short_name": "Tamper Data", 9 | 10 | "icons": { 11 | "48": "icons/icon-tamper-48.png", 12 | "32": "icons/icon-tamper-32.png", 13 | "16": "icons/icon-tamper-16.png" 14 | }, 15 | 16 | "permissions": [ 17 | "webRequest", 18 | "webRequestBlocking", 19 | "" 20 | ], 21 | 22 | "background": { 23 | "scripts": ["background/td.js"] 24 | }, 25 | 26 | "browser_action": { 27 | "default_icon": { 28 | "48": "icons/icon-notamper-48.png", 29 | "32": "icons/icon-notamper-32.png", 30 | "16": "icons/icon-notamper-16.png" 31 | } 32 | }, 33 | 34 | "developer": { 35 | "name": "Pamblam", 36 | "url": "http://pamblam.com" 37 | }, 38 | 39 | "homepage_url": "https://github.com/Pamblam/Tamper-Data-for-FF-Quantum" 40 | 41 | 42 | } -------------------------------------------------------------------------------- /popups/confirm_tamper/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Start Tamper Data 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

Listen for types

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 36 | 39 | 40 | 41 | 44 | 47 | 48 | 49 | 52 | 55 | 56 | 57 | 60 | 63 | 64 | 65 | 68 | 71 | 72 | 73 | 76 | 79 | 80 | 81 | 84 | 87 | 88 | 89 | 92 | 95 | 96 | 97 | 100 | 103 | 104 | 105 | 108 | 111 | 112 | 113 | 116 | 119 | 120 | 121 | 124 | 127 | 128 | 129 | 132 | 135 | 136 | 137 | 140 | 143 | 144 | 145 | 148 | 151 | 152 | 153 | 156 | 159 | 160 | 161 | 164 | 167 | 168 | 169 | 172 | 175 | 176 | 177 | 180 | 183 | 184 | 185 | 188 | 191 | 192 | 193 |
TypeDescription
27 | 28 | 29 | Requests sent through the Beacon API. 30 |
34 | 35 | 37 | Requests sent to the report-uri given in the Content-Security-Policy header, when an attempt to violate the policy is detected. 38 |
42 | 43 | 45 | Web fonts loaded for a @font-face CSS rule. 46 |
50 | 51 | 53 | Resources loaded to be rendered as image, except for imageset on browsers that support that type. 54 |
58 | 59 | 61 | Images loaded by a <picture> element or given in an <img> element's srcset attribute. 62 |
66 | 67 | 69 | Top-level documents loaded into a tab. 70 |
74 | 75 | 77 | Resources loaded by a <video> or <audio> element. 78 |
82 | 83 | 85 | Resources loaded by an <object> or <embed> element. 86 |
90 | 91 | 93 | Requests sent by plugins. 94 |
98 | 99 | 101 | Requests sent to the URL given in a hyperlink's ping attribute, when the hypelink is followed. 102 |
106 | 107 | 109 | Code that is loaded to be executed by a <script> element or running in a Worker. 110 |
114 | 115 | 117 | A TCP/TLS handshake made by the browser when it determines it will need the connection open soon. 118 |
122 |
123 |
125 | CSS stylesheets loaded to describe the representation of a document. 126 |
130 | 131 | 133 | Documents loaded into an <iframe> or <frame> element. 134 |
138 | 139 | 141 | Web App Manifests loaded for websites that can be installed to the homescreen. 142 |
146 | 147 | 149 | Requests initiating a connection to a server through the WebSocket API. 150 |
154 |
155 |
157 | XBL bindings loaded to extend the behavior of elements in a document. 158 |
162 | 163 | 165 | DTDs loaded for an XML document. 166 |
170 | 171 | 173 | Requests sent by an XMLHttpRequest object or through the Fetch API. 174 |
178 | 179 | 181 | XSLT stylesheets loaded for transforming an XML document. 182 |
186 | 187 | 189 | Resources that aren't covered by any other available type. 190 |
194 |
195 | 196 |
197 | 198 |
199 |

Start Tamper Data?

200 |   201 |
202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /popups/confirm_tamper/popup.js: -------------------------------------------------------------------------------- 1 | 2 | document.getElementById("n").onclick = ()=>respond(false); 3 | document.getElementById("y").onclick = ()=>respond(true); 4 | 5 | function respond(r) { 6 | var types = []; 7 | Array.from(document.querySelectorAll(".types")).forEach(inp=>{ 8 | if(inp.checked) types.push(inp.value); 9 | }); 10 | browser.runtime.sendMessage({ 11 | tamper: r, 12 | types: types, 13 | tab: document.getElementById("tab").checked, 14 | pattern: document.getElementById("matchregex").value 15 | }); 16 | } 17 | 18 | function firefox57_workaround_for_blank_panel() { 19 | browser.windows.getCurrent().then((currentWindow) => { 20 | browser.windows.update(currentWindow.id, { 21 | width: currentWindow.width, 22 | height: currentWindow.height + 1, // 1 pixel more than original size... 23 | }); 24 | }); 25 | } 26 | 27 | function load_last_options() { 28 | const last_options = JSON.parse(decodeURIComponent(window.location.href.split("?")[1])); 29 | 30 | last_options.types = last_options.types.reduce((acc, value) => { 31 | acc[value] = true; 32 | return acc; 33 | }, {}); 34 | if (Object.keys(last_options.types).length === 0) 35 | last_options.types = { main_frame: true, xmlhttprequest: true }; 36 | document.querySelectorAll(".types").forEach((elem) => { 37 | elem.checked = last_options.types[elem.value]; 38 | }); 39 | 40 | document.querySelector("#matchregex").value = last_options.pattern || "(.*?)"; 41 | document.querySelector("#tab").checked = last_options.tab; 42 | } 43 | 44 | firefox57_workaround_for_blank_panel(); 45 | load_last_options(); 46 | -------------------------------------------------------------------------------- /popups/confirm_tamper/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-family: 'Roboto', sans-serif; 3 | background-position: center; 4 | background-repeat: no-repeat; 5 | background-size: contain; 6 | } 7 | .myButton { 8 | -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; 9 | -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; 10 | box-shadow:inset 0px 1px 0px 0px #ffffff; 11 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9)); 12 | background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 13 | background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 14 | background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 15 | background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 16 | background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%); 17 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0); 18 | background-color:#f9f9f9; 19 | -moz-border-radius:6px; 20 | -webkit-border-radius:6px; 21 | border-radius:6px; 22 | border:1px solid #dcdcdc; 23 | display:inline-block; 24 | cursor:pointer; 25 | color:#666666; 26 | font-family:Arial; 27 | font-size:15px; 28 | font-weight:bold; 29 | padding:6px 24px; 30 | text-decoration:none; 31 | text-shadow:0px 1px 0px #ffffff; 32 | } 33 | .myButton:hover { 34 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9)); 35 | background:-moz-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 36 | background:-webkit-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 37 | background:-o-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 38 | background:-ms-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 39 | background:linear-gradient(to bottom, #e9e9e9 5%, #f9f9f9 100%); 40 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9',GradientType=0); 41 | background-color:#e9e9e9; 42 | } 43 | .myButton:active { 44 | position:relative; 45 | top:1px; 46 | } 47 | p{ 48 | font-size:15px; 49 | font-weight:bold; 50 | } 51 | table.paleBlueRows { 52 | font-family: "Times New Roman", Times, serif; 53 | border: 1px solid #FFFFFF; 54 | text-align: center; 55 | border-collapse: collapse; 56 | } 57 | table.paleBlueRows td, table.paleBlueRows th { 58 | border: 1px solid #FFFFFF; 59 | padding: 3px 2px; 60 | } 61 | table.paleBlueRows tbody td { 62 | font-size: 13px; 63 | } 64 | table.paleBlueRows tr:nth-child(even) { 65 | background: #D0E4F5; 66 | } 67 | table.paleBlueRows thead { 68 | background: #0B6FA4; 69 | border-bottom: 5px solid #FFFFFF; 70 | } 71 | table.paleBlueRows thead th { 72 | font-size: 17px; 73 | font-weight: bold; 74 | color: #FFFFFF; 75 | text-align: center; 76 | border-left: 2px solid #FFFFFF; 77 | } 78 | table.paleBlueRows thead th:first-child { 79 | border-left: none; 80 | } 81 | 82 | table.paleBlueRows tfoot { 83 | font-size: 14px; 84 | font-weight: bold; 85 | color: #333333; 86 | background: #D0E4F5; 87 | border-top: 3px solid #444444; 88 | } 89 | table.paleBlueRows tfoot td { 90 | font-size: 14px; 91 | } -------------------------------------------------------------------------------- /popups/confirm_tamper/styles.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/Tamper-Data-for-FF-Quantum/fbe1c9a3a1c36c2d4944b22eae062a0c0ee0ba3d/popups/confirm_tamper/styles.css -------------------------------------------------------------------------------- /popups/tamper_body/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Start Tamper Data 10 | 11 | 12 | 13 | 14 | 15 | 16 |

Details

17 | 18 | 19 | 20 | 21 | 22 | 23 |
URL
Method
Type
24 |

Request Body

25 |
This request has no request body.
26 |
NameValue
27 |
28 |
29 | 30 |
31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /popups/tamper_body/popup.js: -------------------------------------------------------------------------------- 1 | 2 | var data = JSON.parse(decodeURIComponent(window.location.href.split("?")[1])); 3 | 4 | document.getElementById("url").value = data.url; 5 | 6 | document.getElementById("method").appendChild(document.createTextNode(data.method)); 7 | document.getElementById("type").appendChild(document.createTextNode(data.type)); 8 | 9 | var norq = document.getElementById('norq'); 10 | var bodytbl = document.getElementById('bodytbl'); 11 | if(data.body.length) norq.parentNode.removeChild(norq); 12 | else bodytbl.parentNode.removeChild(bodytbl); 13 | 14 | var tbody = document.getElementById('bodybody'); 15 | data.body.forEach(body=>{ 16 | var row = document.createElement("tr"); 17 | var td1 = document.createElement("td"); 18 | var tn1 = document.createTextNode(body.name); 19 | td1.appendChild(tn1); 20 | row.appendChild(td1); 21 | var td2 = document.createElement("td"); 22 | var inpt = document.createElement("input"); 23 | inpt.setAttribute('value', body.value); 24 | inpt.setAttribute('readonly', 'readonly'); 25 | td2.appendChild(inpt); 26 | row.appendChild(td2); 27 | tbody.appendChild(row); 28 | }); 29 | 30 | document.getElementById('ok').onclick = function(){ 31 | var url = document.getElementById("url").value; 32 | browser.runtime.sendMessage({ 33 | cancel: false, 34 | redirect: data.url != url ? url : false 35 | }); 36 | }; 37 | 38 | document.getElementById('stop').onclick = function(){ 39 | var url = document.getElementById("url").value; 40 | browser.runtime.sendMessage({ 41 | cancel: false, 42 | stop: true, 43 | redirect: data.url != url ? url : false 44 | }); 45 | }; 46 | 47 | document.getElementById('cancel').onclick = function(){ 48 | browser.runtime.sendMessage({ 49 | cancel: true 50 | }); 51 | }; 52 | 53 | function firefox57_workaround_for_blank_panel() { 54 | browser.windows.getCurrent().then((currentWindow) => { 55 | browser.windows.update(currentWindow.id, { 56 | width: currentWindow.width, 57 | height: currentWindow.height + 1, // 1 pixel more than original size... 58 | }); 59 | }); 60 | } 61 | 62 | firefox57_workaround_for_blank_panel(); -------------------------------------------------------------------------------- /popups/tamper_body/style.css: -------------------------------------------------------------------------------- 1 | body, *{ 2 | font-family: 'Roboto', sans-serif; n; 3 | } 4 | .myButton { 5 | -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; 6 | -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; 7 | box-shadow:inset 0px 1px 0px 0px #ffffff; 8 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9)); 9 | background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 10 | background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 11 | background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 12 | background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 13 | background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%); 14 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0); 15 | background-color:#f9f9f9; 16 | -moz-border-radius:6px; 17 | -webkit-border-radius:6px; 18 | border-radius:6px; 19 | border:1px solid #dcdcdc; 20 | display:inline-block; 21 | cursor:pointer; 22 | color:#666666; 23 | font-family:Arial; 24 | font-size:15px; 25 | font-weight:bold; 26 | padding:6px 24px; 27 | text-decoration:none; 28 | text-shadow:0px 1px 0px #ffffff; 29 | } 30 | .myButton:hover { 31 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9)); 32 | background:-moz-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 33 | background:-webkit-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 34 | background:-o-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 35 | background:-ms-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 36 | background:linear-gradient(to bottom, #e9e9e9 5%, #f9f9f9 100%); 37 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9',GradientType=0); 38 | background-color:#e9e9e9; 39 | } 40 | .myButton:active { 41 | position:relative; 42 | top:1px; 43 | } 44 | .toptable{ width:100%; } 45 | h3{display: inline-block; } 46 | table.paleBlueRows { 47 | font-family: "Times New Roman", Times, serif; 48 | border: 1px solid #FFFFFF; 49 | width: 350px; 50 | height: 200px; 51 | text-align: center; 52 | border-collapse: collapse; 53 | } 54 | table.paleBlueRows td, table.paleBlueRows th { 55 | border: 1px solid #FFFFFF; 56 | padding: 3px 2px; 57 | } 58 | table.paleBlueRows tbody td { 59 | font-size: 13px; 60 | } 61 | table.paleBlueRows tr:nth-child(even) { 62 | background: #D0E4F5; 63 | } 64 | table.paleBlueRows thead { 65 | background: #0B6FA4; 66 | border-bottom: 5px solid #FFFFFF; 67 | } 68 | table.paleBlueRows thead th { 69 | font-size: 17px; 70 | font-weight: bold; 71 | color: #FFFFFF; 72 | text-align: center; 73 | border-left: 2px solid #FFFFFF; 74 | } 75 | table.paleBlueRows thead th:first-child { 76 | border-left: none; 77 | } 78 | 79 | table.paleBlueRows tfoot { 80 | font-size: 14px; 81 | font-weight: bold; 82 | color: #333333; 83 | background: #D0E4F5; 84 | border-top: 3px solid #444444; 85 | } 86 | table.paleBlueRows tfoot td { 87 | font-size: 14px; 88 | } 89 | .block{ display: block; width:100%; } 90 | .buttons{ 91 | float:right; 92 | } -------------------------------------------------------------------------------- /popups/tamper_headers/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Start Tamper Data 10 | 11 | 12 | 13 | 14 | 15 | 16 |

Details

17 | 18 | 19 | 20 | 21 | 22 | 23 |
URL
Method
Type
24 |

Headers

25 |
NameValue
26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /popups/tamper_headers/popup.js: -------------------------------------------------------------------------------- 1 | 2 | var data = JSON.parse(decodeURIComponent(window.location.href.split("?")[1])); 3 | 4 | document.getElementById("url").value = data.url; 5 | document.getElementById("method").appendChild(document.createTextNode(data.method)); 6 | document.getElementById("type").appendChild(document.createTextNode(data.type)); 7 | 8 | var tbody = document.getElementById('headersbody'); 9 | data.headers.forEach(addHeader); 10 | 11 | document.getElementById('ok').onclick = function(){ 12 | browser.runtime.sendMessage({ 13 | headers: getHeaders(), 14 | }); 15 | }; 16 | 17 | document.getElementById('stop').onclick = function(){ 18 | browser.runtime.sendMessage({ 19 | headers: getHeaders(), 20 | stop: true 21 | }); 22 | }; 23 | 24 | document.getElementById("addHeader").addEventListener("click", () => addHeader()); 25 | 26 | function firefox57_workaround_for_blank_panel() { 27 | browser.windows.getCurrent().then((currentWindow) => { 28 | browser.windows.update(currentWindow.id, { 29 | width: currentWindow.width, 30 | height: currentWindow.height + 1, // 1 pixel more than original size... 31 | }); 32 | }); 33 | } 34 | 35 | function addHeader(header) { 36 | var row = document.createElement("tr"); 37 | row.classList.add("row"); 38 | 39 | var td1 = document.createElement("td"); 40 | var inpt1 = document.createElement("input"); 41 | inpt1.classList.add("headerName"); 42 | if (header) 43 | inpt1.value = header.name; 44 | td1.appendChild(inpt1); 45 | row.appendChild(td1); 46 | 47 | var td2 = document.createElement("td"); 48 | var inpt2 = document.createElement("input"); 49 | inpt2.classList.add("headerValue"); 50 | if (header) 51 | inpt2.setAttribute('value', header.value); 52 | td2.appendChild(inpt2); 53 | row.appendChild(td2); 54 | 55 | var td3 = document.createElement("td"); 56 | var button = document.createElement("button"); 57 | button.textContent = "-"; 58 | button.addEventListener("click", () => row.remove()); 59 | td3.appendChild(button); 60 | row.appendChild(td3); 61 | 62 | tbody.appendChild(row); 63 | } 64 | 65 | function getHeaders() { 66 | var headers = []; 67 | Array.from(document.querySelectorAll(".row")).forEach(row=>{ 68 | // Headers with empty name or value are ignored by the API. 69 | headers.push({ 70 | name: row.querySelector(".headerName").value, 71 | value: row.querySelector(".headerValue").value, 72 | }); 73 | }); 74 | 75 | return headers; 76 | } 77 | 78 | 79 | firefox57_workaround_for_blank_panel(); 80 | -------------------------------------------------------------------------------- /popups/tamper_headers/style.css: -------------------------------------------------------------------------------- 1 | body, *{ 2 | font-family: 'Roboto', sans-serif; 3 | } 4 | .myButton { 5 | -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; 6 | -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; 7 | box-shadow:inset 0px 1px 0px 0px #ffffff; 8 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9)); 9 | background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 10 | background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 11 | background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 12 | background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); 13 | background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%); 14 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0); 15 | background-color:#f9f9f9; 16 | -moz-border-radius:6px; 17 | -webkit-border-radius:6px; 18 | border-radius:6px; 19 | border:1px solid #dcdcdc; 20 | display:inline-block; 21 | cursor:pointer; 22 | color:#666666; 23 | font-family:Arial; 24 | font-size:15px; 25 | font-weight:bold; 26 | padding:6px 24px; 27 | text-decoration:none; 28 | text-shadow:0px 1px 0px #ffffff; 29 | } 30 | .myButton:hover { 31 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9)); 32 | background:-moz-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 33 | background:-webkit-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 34 | background:-o-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 35 | background:-ms-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%); 36 | background:linear-gradient(to bottom, #e9e9e9 5%, #f9f9f9 100%); 37 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9',GradientType=0); 38 | background-color:#e9e9e9; 39 | } 40 | .myButton:active { 41 | position:relative; 42 | top:1px; 43 | } 44 | .toptable{ width:100%; } 45 | h3{display: inline-block; } 46 | table.paleBlueRows { 47 | font-family: "Times New Roman", Times, serif; 48 | border: 1px solid #FFFFFF; 49 | width: 350px; 50 | height: 200px; 51 | text-align: center; 52 | border-collapse: collapse; 53 | } 54 | table.paleBlueRows td, table.paleBlueRows th { 55 | border: 1px solid #FFFFFF; 56 | padding: 3px 2px; 57 | } 58 | table.paleBlueRows tbody td { 59 | font-size: 13px; 60 | } 61 | table.paleBlueRows tr:nth-child(even) { 62 | background: #D0E4F5; 63 | } 64 | table.paleBlueRows thead { 65 | background: #0B6FA4; 66 | border-bottom: 5px solid #FFFFFF; 67 | } 68 | table.paleBlueRows thead th { 69 | font-size: 17px; 70 | font-weight: bold; 71 | color: #FFFFFF; 72 | text-align: center; 73 | border-left: 2px solid #FFFFFF; 74 | } 75 | table.paleBlueRows thead th:first-child { 76 | border-left: none; 77 | } 78 | 79 | table.paleBlueRows tfoot { 80 | font-size: 14px; 81 | font-weight: bold; 82 | color: #333333; 83 | background: #D0E4F5; 84 | border-top: 3px solid #444444; 85 | } 86 | table.paleBlueRows tfoot td { 87 | font-size: 14px; 88 | } 89 | .block{ display: block; width:100%; } 90 | .buttons{ 91 | float:right; 92 | } --------------------------------------------------------------------------------