Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.0.7] - 2025-03-20

- Do not try to rerun extension setup if already logged in

## [3.0.6] - 2024-09-04

- Fix onboarding on Safari
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelogin-extension",
"version": "3.0.6",
"version": "3.0.7",
"betaRev": "0",
"description": "SimpleLogin Browser Extension",
"author": "extension@simplelogin.io",
Expand All @@ -10,6 +10,7 @@
"prettier:write": "npm run prettier -- --write",
"prettier:check": "prettier --check \"src/**/*.{js,vue}\"",
"build": "cross-env NODE_ENV=production webpack",
"build:dev": "cross-env NODE_ENV=development webpack",
"build:firefox": "cross-env NODE_ENV=production FIREFOX=1 webpack",
"build:firefox:beta": "cross-env NODE_ENV=production BETA=1 FIREFOX=1 webpack",
"build:lite": "cross-env NODE_ENV=production LITE=1 webpack",
Expand Down
6 changes: 4 additions & 2 deletions src/background/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import Utils from "../popup/Utils";
* Get app settings
*/
async function handleGetAppSettings() {
const apiKey = await SLStorage.get(SLStorage.SETTINGS.API_KEY);
return {
showSLButton:
(await SLStorage.get(SLStorage.SETTINGS.API_KEY)) !== "" &&
(await SLStorage.get(SLStorage.SETTINGS.SHOW_SL_BUTTON)),
apiKey !== "" && (await SLStorage.get(SLStorage.SETTINGS.SHOW_SL_BUTTON)),
isLoggedIn: apiKey !== "",
url: await SLStorage.get(SLStorage.SETTINGS.API_URL),
SLButtonPosition: await SLStorage.get(
SLStorage.SETTINGS.SL_BUTTON_POSITION
),
Expand Down
9 changes: 9 additions & 0 deletions src/content_script/input_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,15 @@ if (!window._hasExecutedSlExtension) {
if (!event.data) return;
if (!event.data.tag) return;
if (event.data.tag === "PERFORM_EXTENSION_SETUP") {
const SLSettings = await sendMessageToBackground("GET_APP_SETTINGS");
if (SLSettings.isLoggedIn) {
console.log(
"Received PERFORM_EXTENSION_SETUP but extension is already logged in. Redirecting to dashboard"
);
window.location.href = `${SLSettings.url}/dashboard/`;
return;
}

if (!hasProcessedSetup) {
hasProcessedSetup = true;
const apiUrl = await sendMessageToBackground("EXTENSION_SETUP");
Expand Down
29 changes: 18 additions & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,17 @@ const config = {
],
};

console.log(`[Build] Using config.mode = ${config.mode}`);

if (config.mode === 'development') {
const pluginConfig = {
'devConfig': JSON.stringify(devConfig),
'process.env.BETA': JSON.stringify(!!process.env.BETA),
};

console.log(`[development] Using pluginConfig: ${JSON.stringify(pluginConfig)}`);
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
'devConfig': JSON.stringify(devConfig),
'process.env.BETA': JSON.stringify(!!process.env.BETA),
}),
new webpack.DefinePlugin(pluginConfig),
]);
}

Expand All @@ -177,14 +182,16 @@ if (process.env.MAC){
}

if (config.mode === 'production') {
const pluginConfig = {
'devConfig': 'null',
'process.env': {
'NODE_ENV': '"production"',
'BETA': JSON.stringify(!!process.env.BETA),
}
};
console.log(`[production] Using pluginConfig: ${JSON.stringify(pluginConfig)}`);
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
'devConfig': 'null',
'process.env': {
'NODE_ENV': '"production"',
'BETA': JSON.stringify(!!process.env.BETA),
},
}),
new webpack.DefinePlugin(pluginConfig),
]);
}

Expand Down