Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/extension/src/background.js
const extension = require('extensionizer'); | const extension = require('extensionizer'); | ||||
const NOTIFICATION_HEIGHT = 600; | const NOTIFICATION_HEIGHT = 600; | ||||
const NOTIFICATION_WIDTH = 400; | const NOTIFICATION_WIDTH = 400; | ||||
let popupIsOpen = false; | |||||
let notificationIsOpen = false; | |||||
const openMetamaskTabsIDs = {}; | |||||
const requestAccountTabIds = {}; | |||||
// This starts listening to the port created with `extension.runtime.connect` in contentscript.js | // This starts listening to the port created with `extension.runtime.connect` in contentscript.js | ||||
extension.runtime.onConnect.addListener(function (port) { | extension.runtime.onConnect.addListener(function (port) { | ||||
console.assert(port.name == 'cashtabPort'); | console.assert(port.name == 'cashtabPort'); | ||||
port.onMessage.addListener(function (msg) { | port.onMessage.addListener(function (msg) { | ||||
// Handle a transaction creation request | // Handle a transaction creation request | ||||
if (msg.text == `Cashtab` && msg.txInfo) { | if (msg.text == `Cashtab` && msg.txInfo) { | ||||
console.log( | console.log( | ||||
`Received a transaction request, opening Cashtab extension`, | `Received a transaction request, opening Cashtab extension`, | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |