Skip to content

Commit edd7da8

Browse files
authored
revert: skip simulation on verified dapps (#126)
* revert: skip simulation on verified dapps * remove from settings
1 parent 3af26cf commit edd7da8

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

src/background.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { WgKeys } from './lib/helpers/chrome/localStorageKeys';
2828
import * as Sentry from '@sentry/react';
2929
import Browser from 'webextension-polyfill';
3030
import { SUPPORTED_CHAINS } from './lib/config/features';
31-
import { KNOWN_MARKETPLACES } from './lib/simulation/skip';
3231

3332
const log = logger.child({ component: 'Background' });
3433
const approvedTxns: TransactionArgs[] = [];
@@ -343,12 +342,12 @@ const contentScriptMessageHandler = async (message: PortMessage, sourcePort: Bro
343342
const settings = await localStorageHelpers.get<ExtensionSettings>(WgKeys.ExtensionSettings);
344343
if (!settings?.simulationEnabled) return;
345344

346-
if ('transaction' in message.data) {
347-
const address = message.data.transaction?.to?.toLowerCase();
348-
if (KNOWN_MARKETPLACES.includes(address)) {
349-
return;
350-
}
351-
}
345+
// if ('transaction' in message.data) {
346+
// const address = message.data.transaction?.to?.toLowerCase();
347+
// if (KNOWN_MARKETPLACES.includes(address)) {
348+
// return;
349+
// }
350+
// }
352351

353352
// Check if the transaction was already simulated and confirmed
354353
const isApproved = findApprovedTransaction(approvedTxns, message.data);

src/content-scripts/contentScripts.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type { StoredSimulation } from '../lib/simulation/storage';
88
import { removeSimulation, StoredSimulationState } from '../lib/simulation/storage';
99
import { TransactionArgs } from '../models/simulation/Transaction';
1010
import { ExtensionSettings } from '../lib/settings';
11-
import { IsOfficialMarketplace } from '../lib/simulation/skip';
1211

1312
// Function to inject scripts into browser
1413
const addScript = (url: string) => {
@@ -47,13 +46,9 @@ listenToRequest(async (request: TransactionArgs) => {
4746
request.origin = currentTab;
4847
}
4948

50-
const isOfficialMarketplace = await IsOfficialMarketplace(request);
51-
5249
// Get User Settings
5350
localStorageHelpers.get<ExtensionSettings>(WgKeys.ExtensionSettings).then((settings) => {
54-
const shouldSkip = settings?.skipOnOfficialMarketplaces && isOfficialMarketplace;
55-
56-
if (!settings || !settings.simulationEnabled || shouldSkip) {
51+
if (!settings || !settings.simulationEnabled) {
5752
// Immediately respond continue.
5853
dispatchResponse({
5954
id: request.id,

src/lib/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ export interface ExtensionSettings {
33
simulationEnabled: boolean;
44
maliciousExtensionDetection: boolean;
55
approvalNotifications: boolean;
6-
skipOnOfficialMarketplaces: boolean;
76
}
87

98
export const WG_EXTENSION_DEFAULT_SETTINGS: ExtensionSettings = {
109
phishingDetection: true,
1110
simulationEnabled: true,
1211
maliciousExtensionDetection: true,
1312
approvalNotifications: true,
14-
skipOnOfficialMarketplaces: false,
1513
};

0 commit comments

Comments
 (0)