diff --git a/packages/desktop/electron/main.js b/packages/desktop/electron/main.js index 3d1a15ada2c..526a5a8ed6c 100644 --- a/packages/desktop/electron/main.js +++ b/packages/desktop/electron/main.js @@ -175,40 +175,6 @@ if (app.isPackaged) { paths.errorHtml = path.join(__dirname, '../error.html') } -/** - * Check URL against allowlist - */ -function isUrlAllowed(targetUrl) { - const externalAllowlist = [ - // IOTA Foundation - 'blog.iota.org', - 'chrysalis.iota.org', - 'chrysalis.docs.iota.org', - 'discord.iota.org', - 'firefly.iota.org', - 'iota.org', - 'privacy@iota.org', - 'wiki.iota.org', - 'explorer.iota.org', - - // Assembly / Shimmer - 'assembly.sc', - 'shimmer.network', - 'explorer.shimmer.network', - - // GitHub - 'github.com/iotaledger/firefly/issues', - 'github.com/iotaledger/firefly/issues/new/choose', - - // Other - 'support.ledger.com', - ] - const url = new URL(targetUrl) - const domain = url.hostname.replace('www.', '').replace('mailto:', '') - - return externalAllowlist.includes(domain) || externalAllowlist.includes(domain + url.pathname) -} - /** * Handles url navigation events */ @@ -216,9 +182,7 @@ const handleNavigation = (e, url) => { e.preventDefault() try { - if (isUrlAllowed(url)) { - shell.openExternal(url) - } + shell.openExternal(url) } catch (err) { console.error(err) } @@ -325,7 +289,7 @@ function createWindow() { * Handle permissions requests */ session.defaultSession.setPermissionRequestHandler((_webContents, permission, cb, details) => { - if (permission === 'openExternal' && details && details.externalURL && isUrlAllowed(details.externalURL)) { + if (permission === 'openExternal' && details && details.externalURL) { return cb(true) } diff --git a/packages/desktop/views/dashboard/collectibles/views/DetailsView.svelte b/packages/desktop/views/dashboard/collectibles/views/DetailsView.svelte index de19d19de97..df87830b746 100644 --- a/packages/desktop/views/dashboard/collectibles/views/DetailsView.svelte +++ b/packages/desktop/views/dashboard/collectibles/views/DetailsView.svelte @@ -21,7 +21,7 @@ import { ActivityType, formatTokenAmountPrecise } from '@core/wallet' import { BASE_TOKEN } from '@core/network/constants' import { activeProfile } from '@core/profile/stores' - import { Platform } from '@core/app' + import { openUrlInBrowser } from '@core/app' import { ExplorerEndpoint, getOfficialExplorerUrl } from '@core/network' import { openPopup } from '@auxiliary/popup' @@ -58,7 +58,7 @@ } function handleExplorerClick(): void { - Platform.openUrl(`${explorerUrl}/${ExplorerEndpoint.Nft}/${id}`) + openUrlInBrowser(`${explorerUrl}/${ExplorerEndpoint.Nft}/${id}`) } function handleSendClick(): void { diff --git a/packages/desktop/views/dashboard/settings/views/help/HelpSection.svelte b/packages/desktop/views/dashboard/settings/views/help/HelpSection.svelte index dfaa7075984..ab91a6e9853 100644 --- a/packages/desktop/views/dashboard/settings/views/help/HelpSection.svelte +++ b/packages/desktop/views/dashboard/settings/views/help/HelpSection.svelte @@ -1,7 +1,7 @@ diff --git a/packages/desktop/views/onboarding/views/app-setup/views/ConditionsOfUse.svelte b/packages/desktop/views/onboarding/views/app-setup/views/ConditionsOfUse.svelte index 00a2a3b90ca..2acee0d3f23 100644 --- a/packages/desktop/views/onboarding/views/app-setup/views/ConditionsOfUse.svelte +++ b/packages/desktop/views/onboarding/views/app-setup/views/ConditionsOfUse.svelte @@ -1,6 +1,6 @@
@@ -102,7 +102,7 @@ 2. Data Protection IOTA does not collect any of your personal data through the App. Please refer to the Firefly Privacy Policy ( - Platform.openUrl('https://firefly.iota.org/privacy')}> + openUrlInBrowser('https://firefly.iota.org/privacy')}> https://firefly.iota.org/privacy ) for information on how we and our third-party service providers process data in relation to the App. @@ -399,7 +399,7 @@ This Privacy Policy is dedicated to the users of the App. If you would like to know more about how the IOTA Foundation (hereinafter "IOTA", "we", "us", "our") processes Personal Data collected and processed in connection with other services and activities offered by IOTA, please see IOTA's general Privacy Policy available at - Platform.openUrl('https://www.iota.org/privacy-policy')}> + openUrlInBrowser('https://www.iota.org/privacy-policy')}> https://www.iota.org/privacy-policy . diff --git a/packages/shared/components/molecules/activity-info/GenericActivityInformation.svelte b/packages/shared/components/molecules/activity-info/GenericActivityInformation.svelte index c7de3fc9e39..a6015b02f4c 100644 --- a/packages/shared/components/molecules/activity-info/GenericActivityInformation.svelte +++ b/packages/shared/components/molecules/activity-info/GenericActivityInformation.svelte @@ -5,7 +5,7 @@ import { Activity, formatTokenAmountPrecise } from '@core/wallet' import { BASE_TOKEN, ExplorerEndpoint } from '@core/network' import { getOfficialExplorerUrl } from '@core/network/utils' - import { Platform } from '@core/app' + import { openUrlInBrowser } from '@core/app' import { truncateString } from '@core/utils' import { setClipboard } from '@core/utils' @@ -68,7 +68,7 @@ function handleTransactionIdClick(): void { explorerUrl - ? Platform.openUrl( + ? openUrlInBrowser( `${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity.asyncData?.claimingTransactionId}` ) : setClipboard(activity.asyncData?.claimingTransactionId) diff --git a/packages/shared/components/popups/ActivityDetailsPopup.svelte b/packages/shared/components/popups/ActivityDetailsPopup.svelte index e8e2c6816e9..1fc67fb8fab 100644 --- a/packages/shared/components/popups/ActivityDetailsPopup.svelte +++ b/packages/shared/components/popups/ActivityDetailsPopup.svelte @@ -12,7 +12,7 @@ NftActivityDetails, ActivityInformation, } from 'shared/components' - import { Platform } from '@core/app' + import { openUrlInBrowser } from '@core/app' import { ActivityAsyncStatus, ActivityDirection, @@ -84,7 +84,7 @@ } function handleExplorerClick(): void { - Platform.openUrl(`${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity.transactionId}`) + openUrlInBrowser(`${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity.transactionId}`) } function handleTransactionIdClick(): void { diff --git a/packages/shared/components/popups/ConfirmationPopup.svelte b/packages/shared/components/popups/ConfirmationPopup.svelte index 0c0dcbe5329..6fb9d4e152e 100644 --- a/packages/shared/components/popups/ConfirmationPopup.svelte +++ b/packages/shared/components/popups/ConfirmationPopup.svelte @@ -37,7 +37,7 @@
{#if description} - {description} + {description} {/if} {#if hint} diff --git a/packages/shared/components/popups/LedgerConnectionGuidePopup.svelte b/packages/shared/components/popups/LedgerConnectionGuidePopup.svelte index 10b8a4773f7..21f3b3ccdf1 100644 --- a/packages/shared/components/popups/LedgerConnectionGuidePopup.svelte +++ b/packages/shared/components/popups/LedgerConnectionGuidePopup.svelte @@ -1,6 +1,6 @@