Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 Google Inc. | |
| 2 // | |
| 3 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 4 // Use of this source code is governed by a BSD-style license that can be | |
| 5 // found in the LICENSE file. | |
| 6 | |
| 7 // For cs.chromium.org | |
| 8 | |
| 9 let line = 0; | |
| 10 | |
| 11 document.addEventListener("mousedown", (event) => { | |
| 12 //right click | |
|
watk
2017/03/02 23:13:49
Proper punctuation. Space after //.
| |
| 13 if (event.button == 2) { | |
| 14 let element = event.target; | |
| 15 while (element != null && element.tagName == "SPAN") { | |
| 16 if (element.className == "stx-line") { | |
| 17 line = parseInt(element.id.split("_")[1]); | |
| 18 break; | |
| 19 } else { | |
| 20 element = element.parentElement; | |
| 21 } | |
| 22 } | |
| 23 } | |
| 24 }, true); | |
| 25 | |
| 26 chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { | |
| 27 if (request == "getLine") { | |
| 28 sendResponse({ line: line }); | |
| 29 } | |
| 30 }); | |
| OLD | NEW |