Skip to content

Commit 232a64d

Browse files
chore: remove port reference from background
1 parent b22e6f2 commit 232a64d

File tree

6 files changed

+0
-173
lines changed

6 files changed

+0
-173
lines changed

source/config/consts.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ const MV3_OPTIONS = {
123123
run_at: 'document_start',
124124
js: ['js/contentScript.bundle.js'],
125125
},
126-
{
127-
matches: [
128-
'*://connect.trezor.io/9/popup.html',
129-
'https://localhost:8088/*',
130-
],
131-
js: ['js/trezorScript.bundle.js'],
132-
},
133126
],
134127
web_accessible_resources: [
135128
{

source/config/webpack.common.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ module.exports = {
2929
contentScript: join(sourcePath, 'scripts/ContentScript', 'index.ts'),
3030
app: join(sourcePath, 'pages/App', 'index.tsx'),
3131
external: join(sourcePath, 'pages/External', 'index.tsx'),
32-
trezorScript: join(
33-
sourcePath,
34-
'scripts/ContentScript/trezor',
35-
'trezor-content-script.ts'
36-
),
37-
trezorUSB: join(
38-
sourcePath,
39-
'scripts/ContentScript/trezor',
40-
'trezor-usb-permissions.ts'
41-
),
4232
offscreenScript: join(
4333
sourcePath,
4434
'scripts/ContentScript/offscreen',
@@ -149,12 +139,6 @@ module.exports = {
149139
hash: true,
150140
filename: 'external.html',
151141
}),
152-
new HtmlWebpackPlugin({
153-
template: join(viewsPath, 'trezor-usb-permissions.html'),
154-
filename: 'trezor-usb-permissions.html',
155-
inject: 'body',
156-
chunks: ['trezorUSB'],
157-
}),
158142
new HtmlWebpackPlugin({
159143
template: join(viewsPath, 'offscreen.html'),
160144
filename: 'offscreen.html',

source/scripts/Background/controllers/DAppController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const DAppController = (): IDAppController => {
4242
};
4343

4444
chrome.runtime.onMessage.addListener(onMessage);
45-
// port.onDisconnect.addListener(onDisconnect); //TODO: make contentScript unavailable to Dapp on disconnection of port
4645
};
4746

4847
const connect = (dapp: IDApp, isDappConnected = false) => {

source/scripts/Background/index.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -245,47 +245,6 @@ chrome.runtime.onMessage.addListener(
245245
}
246246
);
247247

248-
chrome.runtime.onConnect.addListener(async (port) => {
249-
if (port.name === 'pali') {
250-
handleIsOpen(true);
251-
}
252-
253-
const { changingConnectedAccount, timer, isTimerEnabled } =
254-
store.getState().vault;
255-
256-
if (timeout) clearTimeout(timeout);
257-
258-
if (isTimerEnabled) {
259-
timeout = setTimeout(() => {
260-
handleLogout();
261-
}, timer * 60 * 1000);
262-
}
263-
264-
if (
265-
changingConnectedAccount.isChangingConnectedAccount &&
266-
walletMethods?.resolveAccountConflict
267-
)
268-
walletMethods.resolveAccountConflict();
269-
270-
const senderUrl = port.sender.url;
271-
272-
if (
273-
senderUrl?.includes(chrome.runtime.getURL('/app.html')) ||
274-
senderUrl?.includes(chrome.runtime.getURL('/external.html'))
275-
) {
276-
port.onDisconnect.addListener(() => {
277-
handleIsOpen(false);
278-
if (timeout) clearTimeout(timeout);
279-
if (isTimerEnabled) {
280-
timeout = setTimeout(() => {
281-
handleLogout();
282-
}, timer * 60 * 1000);
283-
}
284-
log('pali disconnecting port', 'System');
285-
});
286-
}
287-
});
288-
289248
async function checkForUpdates() {
290249
const { activeAccount, isBitcoinBased, activeNetwork } =
291250
store.getState().vault;

source/scripts/ContentScript/trezor/trezor-content-script.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

source/scripts/ContentScript/trezor/trezor-usb-permissions.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)