michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: Listen for left and right click events and send the corresponding message michael@0: to the content script. michael@0: */ michael@0: michael@0: this.addEventListener('click', function(event) { michael@0: if(event.button == 0 && event.shiftKey == false) michael@0: self.port.emit('left-click'); michael@0: michael@0: if(event.button == 2 || (event.button == 0 && event.shiftKey == true)) michael@0: self.port.emit('right-click'); michael@0: event.preventDefault(); michael@0: }, true);