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