mirror of
https://github.com/andrei0x309/clear-wallet.git
synced 2024-12-19 00:00:45 +00:00
remove: unused extension
This commit is contained in:
parent
1eef70e2f5
commit
eec1d0f355
@ -39,7 +39,7 @@ window.addEventListener("message", (event) => {
|
||||
if((event?.data?.data?.method ?? 'x') in allowedMethods) {
|
||||
chrome.runtime.sendMessage(event.data.data, (res) => {
|
||||
const data = { type: "CLWALLET_PAGE", data: res, resId: event.data.resId, website: window?.location?.href ?? '' };
|
||||
// console.log('data back', data)
|
||||
console.log('data back', data)
|
||||
window.postMessage(data, "*");
|
||||
})
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ return new Promise((resolve, reject) => {
|
||||
if (ping) {
|
||||
data.type = 'CLWALLET_PING'
|
||||
}
|
||||
// console.log('data in', data)
|
||||
console.log('data in', data)
|
||||
window.postMessage(data, "*");
|
||||
})
|
||||
}
|
||||
|
@ -23,7 +23,6 @@
|
||||
"minimum_chrome_version": "93",
|
||||
|
||||
"permissions": [
|
||||
"scripting",
|
||||
"tabs",
|
||||
"notifications",
|
||||
"storage",
|
||||
|
@ -201,17 +201,33 @@ chrome.runtime.onMessage.addListener((message: RequestArguments, sender, sendRes
|
||||
}
|
||||
case 'eth_requestAccounts':
|
||||
case 'eth_accounts': {
|
||||
try {
|
||||
// give only the selected address for better privacy
|
||||
const account = await getSelectedAccount()
|
||||
const address = account?.address ? [account?.address] : []
|
||||
sendResponse(address)
|
||||
break
|
||||
} catch {
|
||||
sendResponse({
|
||||
error: true,
|
||||
code: rpcError.USER_REJECTED,
|
||||
message: 'No network or user selected'
|
||||
})
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'eth_chainId': {
|
||||
try {
|
||||
const network = await getSelectedNetwork()
|
||||
const chainId = network?.chainId ?? 0
|
||||
sendResponse(`0x${chainId.toString(16)}`)
|
||||
break
|
||||
} catch {
|
||||
sendResponse({
|
||||
error: true,
|
||||
code: rpcError.USER_REJECTED,
|
||||
message: 'No network or user selected'
|
||||
})
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'eth_sendTransaction': {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user