2018-04-07 05:20:53 +02:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
2021-04-23 10:45:20 +02:00
|
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
2018-04-07 05:20:53 +02:00
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
2020-05-08 17:54:37 +02:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2021-12-09 21:08:34 +01:00
|
|
|
const { AngularWebpackPlugin } = require("@ngtools/webpack");
|
2022-02-14 15:06:14 +01:00
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
2022-11-17 21:15:34 +01:00
|
|
|
const { TsconfigPathsPlugin } = require("tsconfig-paths-webpack-plugin");
|
2022-08-16 14:05:03 +02:00
|
|
|
const configurator = require("./config/config");
|
2018-04-04 04:14:54 +02:00
|
|
|
|
2018-04-13 21:14:04 +02:00
|
|
|
if (process.env.NODE_ENV == null) {
|
|
|
|
process.env.NODE_ENV = "development";
|
|
|
|
}
|
|
|
|
const ENV = (process.env.ENV = process.env.NODE_ENV);
|
2022-06-27 19:38:12 +02:00
|
|
|
const manifestVersion = process.env.MANIFEST_VERSION == 3 ? 3 : 2;
|
|
|
|
|
|
|
|
console.log(`Building Manifest Version ${manifestVersion} app`);
|
[PM-3285] Autofill v2 Feature Branch (#5939)
* [PM-3285] Autofill v2 Feature Branch
* [PM-2130] - Audit, Modularize, and Refactor Core autofill.js File (#5453)
* split up autofill.ts, first pass
* remove modification tracking comments
* lessen and localize eslint disables
* additional typing and formatting
* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)
* update autofill v2 with PR #4155 changes (add autofill support for textarea)
Co-Authored-By: Manuel <mr-manuel@outlook.it>
* move commonly used string values to constants
* ts cleanup
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Working through autofill collect method
* [PM-2130] Marking Removal of documentUUID as dead code
* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation
* [PM-2130] Applying small refactors to AutofillCollect
* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method
* [PM-2130] Implementing jest tests for AutofillCollect methods
* [PM-2130] Refining implementation for AutofillCollect
* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)
* add unit tests for urlNotSecure
* add test coverage command
* add unit tests for canSeeElementToStyle
* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false
* add tests for selectAllFromDoc and getElementByOpId
* clean up getElementByOpId
* address some typing issues
* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery
* clean up setValueForElement and setValueForElementByEvent
* more typescript cleanup
* add tests for doClickByOpId and touchAllPasswordFields
* add tests for doFocusByOpId and doClickByQuery
* misc fill cleanup
* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId
* add tests for isKnownTag and isElementVisible
* rename addProp and remove redundant focusElement in favor of doFocusElement
* cleanup
* fix checkNodeType
* add tests for shiftForLeftLabel
* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel
* add tests for getFormElements
* clean up getFormElements
* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc
* clean up and rename queryDoc to queryDocument
* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute
* rebase cleanup
* prettier formatting
* [PM-2130] Fixing linting issues
* [PM-2130] Fixing linting issues
* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context
* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect
* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect
* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport
* [PM-2130] Filling out implementation of autofill-insert
* [PM-2130] Refining AutofillInsert
* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service
* [PM-2130] Fixing jest tests for AutofillCollect
* [PM-2130] Fixing jest tests for AutofillInit
* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect
* [PM-2130] Working through AutofillInsert implementation
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field
* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService
* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService
* [PM-2130] Further organization of implementation
* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method
* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService
* [PM-2130] Further refactoring of elements including typing information
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Organization and refactoring of methods within InsertAutofillContent
* [PM-2130] Implementation of jest tests for InsertAutofillContentService
* [PM-2130] Implementation of Jest Test for IntertAutofillContentService
* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces
* [PM-2130] Cleaning up dead code comments
* [PM-2130] Removing unnecessary constants
* [PM-2130] Finalizing jest tests for InsertAutofillContentService
* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior
* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components
* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility
* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing test test for when we need to handle a password reprompt
---------
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
* [PM-3285] Migrating Changes from PM-1407 into autofill v2 refactor implementation
* [PM-2747] Add Support for Feature Flag of Autofill Version (#5695)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* split up autofill.ts, first pass
* remove modification tracking comments
* lessen and localize eslint disables
* additional typing and formatting
* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)
* update autofill v2 with PR #4155 changes (add autofill support for textarea)
Co-Authored-By: Manuel <mr-manuel@outlook.it>
* move commonly used string values to constants
* ts cleanup
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Working through autofill collect method
* [PM-2130] Marking Removal of documentUUID as dead code
* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation
* [PM-2130] Applying small refactors to AutofillCollect
* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method
* [PM-2130] Implementing jest tests for AutofillCollect methods
* [PM-2130] Refining implementation for AutofillCollect
* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)
* add unit tests for urlNotSecure
* add test coverage command
* add unit tests for canSeeElementToStyle
* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false
* add tests for selectAllFromDoc and getElementByOpId
* clean up getElementByOpId
* address some typing issues
* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery
* clean up setValueForElement and setValueForElementByEvent
* more typescript cleanup
* add tests for doClickByOpId and touchAllPasswordFields
* add tests for doFocusByOpId and doClickByQuery
* misc fill cleanup
* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId
* add tests for isKnownTag and isElementVisible
* rename addProp and remove redundant focusElement in favor of doFocusElement
* cleanup
* fix checkNodeType
* add tests for shiftForLeftLabel
* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel
* add tests for getFormElements
* clean up getFormElements
* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc
* clean up and rename queryDoc to queryDocument
* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute
* rebase cleanup
* prettier formatting
* [PM-2130] Fixing linting issues
* [PM-2130] Fixing linting issues
* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context
* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect
* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect
* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport
* [PM-2130] Filling out implementation of autofill-insert
* [PM-2130] Refining AutofillInsert
* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service
* [PM-2130] Fixing jest tests for AutofillCollect
* [PM-2130] Fixing jest tests for AutofillInit
* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect
* [PM-2130] Working through AutofillInsert implementation
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field
* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService
* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService
* [PM-2130] Further organization of implementation
* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method
* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService
* [PM-2130] Further refactoring of elements including typing information
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Organization and refactoring of methods within InsertAutofillContent
* [PM-2130] Implementation of jest tests for InsertAutofillContentService
* [PM-2130] Implementation of Jest Test for IntertAutofillContentService
* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces
* [PM-2130] Cleaning up dead code comments
* [PM-2130] Removing unnecessary constants
* [PM-2130] Finalizing jest tests for InsertAutofillContentService
* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2747] Add Support for Feature Flag of Autofill Version
* [PM-2747] Adding Support for Manifest v3 within the implementation
* [PM-2747] Modifying how the feature flag for autofill is named
* [PM-2747] Modifying main.background.ts to load the ConfigApiService correctly
* [PM-2747] Refactoring trigger of autofill scripts to be a simple immediately invoked function
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior
* [PM-2747] Modifying how we inject the autofill scripts to ensure we are injecting into all frames within a page
* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components
* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility
* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2747] Applying a fix for a race condition that can occur when loading the notification bar and autofiller script login
* [PM-2747] Reverting removal of autofill npm action. Now this will force usage of autofill-v2 regardless of whether a feature flag is set or not
* [PM-2747] Fixing logic error incorporated when merging in master
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2747] Fixing issue present with notification bar merge
* [PM-2130] Fixing test test for when we need to handle a password reprompt
* [PM-2747] Fixing wording for webpack script
* [PM-2747] Addressing stylistic changes requested from code review
* [PM-2747] Addressing stylistic changes requested from code review
---------
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
* [PM-3285] Applying stylistic changes suggested by code review for the feature flag implementation
* [PM-3285] Adding temporary console log to validate which version is being used
* [PM-3285] Removing temporary console log indicating which version of autofill the user is currently loading
---------
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2023-09-07 22:33:04 +02:00
|
|
|
|
2022-08-16 14:05:03 +02:00
|
|
|
const envConfig = configurator.load(ENV);
|
|
|
|
configurator.log(envConfig);
|
2018-04-13 21:14:04 +02:00
|
|
|
|
2018-04-13 22:03:37 +02:00
|
|
|
const moduleRules = [
|
2021-12-21 15:43:35 +01:00
|
|
|
{
|
2018-04-13 22:03:37 +02:00
|
|
|
test: /\.(html)$/,
|
|
|
|
loader: "html-loader",
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
|
|
|
{
|
2018-04-13 22:03:37 +02:00
|
|
|
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
|
|
|
exclude: /loading.svg/,
|
2021-12-09 21:08:34 +01:00
|
|
|
generator: {
|
2022-01-27 19:18:57 +01:00
|
|
|
filename: "popup/fonts/[name][ext]",
|
2018-04-13 22:03:37 +02:00
|
|
|
},
|
2021-12-09 21:08:34 +01:00
|
|
|
type: "asset/resource",
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
2018-04-13 22:03:37 +02:00
|
|
|
{
|
|
|
|
test: /\.(jpe?g|png|gif|svg)$/i,
|
2022-02-02 16:11:09 +01:00
|
|
|
exclude: /.*(bwi-font|glyphicons-halflings-regular)\.svg/,
|
2018-04-13 22:03:37 +02:00
|
|
|
generator: {
|
2022-01-27 19:18:57 +01:00
|
|
|
filename: "popup/images/[name][ext]",
|
2018-04-13 22:03:37 +02:00
|
|
|
},
|
2021-12-09 21:08:34 +01:00
|
|
|
type: "asset/resource",
|
2018-04-13 22:03:37 +02:00
|
|
|
},
|
2023-07-14 21:03:42 +02:00
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: MiniCssExtractPlugin.loader,
|
|
|
|
},
|
|
|
|
"css-loader",
|
|
|
|
"postcss-loader",
|
|
|
|
],
|
|
|
|
},
|
2018-04-13 22:03:37 +02:00
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2021-12-09 21:08:34 +01:00
|
|
|
use: [
|
2018-04-13 22:03:37 +02:00
|
|
|
{
|
2020-05-08 17:54:37 +02:00
|
|
|
loader: MiniCssExtractPlugin.loader,
|
|
|
|
},
|
|
|
|
"css-loader",
|
2020-05-08 18:12:24 +02:00
|
|
|
"sass-loader",
|
2020-05-08 17:54:37 +02:00
|
|
|
],
|
2018-04-13 22:03:37 +02:00
|
|
|
},
|
2018-09-12 05:54:39 +02:00
|
|
|
{
|
2022-07-26 14:48:11 +02:00
|
|
|
test: /\.[cm]?js$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: "babel-loader",
|
|
|
|
options: {
|
|
|
|
configFile: false,
|
|
|
|
plugins: ["@angular/compiler-cli/linker/babel"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2018-09-12 05:54:39 +02:00
|
|
|
},
|
2021-04-23 10:45:20 +02:00
|
|
|
{
|
2022-07-26 14:48:11 +02:00
|
|
|
test: /\.[jt]sx?$/,
|
2021-04-23 10:45:20 +02:00
|
|
|
loader: "@ngtools/webpack",
|
|
|
|
},
|
2023-01-26 15:20:12 +01:00
|
|
|
{
|
|
|
|
test: /\.wasm$/,
|
|
|
|
loader: "base64-loader",
|
|
|
|
type: "javascript/auto",
|
|
|
|
},
|
2018-04-13 22:03:37 +02:00
|
|
|
];
|
|
|
|
|
2022-11-17 21:15:34 +01:00
|
|
|
const requiredPlugins = [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
"process.env": {
|
|
|
|
ENV: JSON.stringify(ENV),
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
new webpack.EnvironmentPlugin({
|
|
|
|
FLAGS: envConfig.flags,
|
|
|
|
DEV_FLAGS: ENV === "development" ? envConfig.devFlags : {},
|
|
|
|
}),
|
|
|
|
];
|
|
|
|
|
2018-04-13 22:03:37 +02:00
|
|
|
const plugins = [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: "./src/popup/index.html",
|
|
|
|
filename: "popup/index.html",
|
2021-03-08 20:58:10 +01:00
|
|
|
chunks: ["popup/polyfills", "popup/vendor-angular", "popup/vendor", "popup/main"],
|
2018-04-13 22:03:37 +02:00
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
2023-01-31 22:08:37 +01:00
|
|
|
template: "./src/autofill/notification/bar.html",
|
2018-04-13 22:03:37 +02:00
|
|
|
filename: "notification/bar.html",
|
2021-04-23 10:45:20 +02:00
|
|
|
chunks: ["notification/bar"],
|
|
|
|
}),
|
|
|
|
new CopyWebpackPlugin({
|
|
|
|
patterns: [
|
2022-06-27 19:38:12 +02:00
|
|
|
manifestVersion == 3
|
|
|
|
? { from: "./src/manifest.v3.json", to: "manifest.json" }
|
2022-06-10 15:41:34 +02:00
|
|
|
: "./src/manifest.json",
|
2022-08-08 13:40:09 +02:00
|
|
|
{ from: "./src/managed_schema.json", to: "managed_schema.json" },
|
2021-04-23 10:45:20 +02:00
|
|
|
{ from: "./src/_locales", to: "_locales" },
|
|
|
|
{ from: "./src/images", to: "images" },
|
|
|
|
{ from: "./src/popup/images", to: "popup/images" },
|
2023-01-31 22:08:37 +01:00
|
|
|
{ from: "./src/autofill/content/autofill.css", to: "content" },
|
2021-04-23 10:45:20 +02:00
|
|
|
],
|
2018-04-13 22:03:37 +02:00
|
|
|
}),
|
2020-05-08 17:54:37 +02:00
|
|
|
new MiniCssExtractPlugin({
|
2020-05-15 00:11:39 +02:00
|
|
|
filename: "[name].css",
|
|
|
|
chunkFilename: "chunk-[id].css",
|
2020-05-08 17:54:37 +02:00
|
|
|
}),
|
2021-12-09 21:08:34 +01:00
|
|
|
new AngularWebpackPlugin({
|
2018-04-13 22:03:37 +02:00
|
|
|
tsConfigPath: "tsconfig.json",
|
|
|
|
entryModule: "src/popup/app.module#AppModule",
|
|
|
|
sourceMap: true,
|
2021-04-23 10:45:20 +02:00
|
|
|
}),
|
|
|
|
new CleanWebpackPlugin({
|
|
|
|
cleanAfterEveryBuildPatterns: ["!popup/fonts/**/*"],
|
|
|
|
}),
|
2021-12-09 21:08:34 +01:00
|
|
|
new webpack.ProvidePlugin({
|
2022-07-26 14:48:11 +02:00
|
|
|
process: "process/browser.js",
|
2021-12-09 21:08:34 +01:00
|
|
|
}),
|
2022-02-14 15:06:14 +01:00
|
|
|
new webpack.SourceMapDevToolPlugin({
|
2022-02-15 15:09:02 +01:00
|
|
|
exclude: [/content\/.*/, /notification\/.*/],
|
2022-02-14 15:06:14 +01:00
|
|
|
filename: "[file].map",
|
|
|
|
}),
|
2022-11-17 21:15:34 +01:00
|
|
|
...requiredPlugins,
|
2021-04-23 10:45:20 +02:00
|
|
|
];
|
|
|
|
|
2022-11-17 21:15:34 +01:00
|
|
|
/**
|
|
|
|
* @type {import("webpack").Configuration}
|
|
|
|
* This config compiles everything but the background
|
|
|
|
*/
|
|
|
|
const mainConfig = {
|
|
|
|
name: "main",
|
2018-09-12 05:54:39 +02:00
|
|
|
mode: ENV,
|
2022-02-14 15:06:14 +01:00
|
|
|
devtool: false,
|
2018-04-04 04:14:54 +02:00
|
|
|
entry: {
|
2021-03-08 20:58:10 +01:00
|
|
|
"popup/polyfills": "./src/popup/polyfills.ts",
|
2018-04-11 03:54:20 +02:00
|
|
|
"popup/main": "./src/popup/main.ts",
|
[PM-3285] Autofill v2 Feature Branch (#5939)
* [PM-3285] Autofill v2 Feature Branch
* [PM-2130] - Audit, Modularize, and Refactor Core autofill.js File (#5453)
* split up autofill.ts, first pass
* remove modification tracking comments
* lessen and localize eslint disables
* additional typing and formatting
* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)
* update autofill v2 with PR #4155 changes (add autofill support for textarea)
Co-Authored-By: Manuel <mr-manuel@outlook.it>
* move commonly used string values to constants
* ts cleanup
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Working through autofill collect method
* [PM-2130] Marking Removal of documentUUID as dead code
* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation
* [PM-2130] Applying small refactors to AutofillCollect
* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method
* [PM-2130] Implementing jest tests for AutofillCollect methods
* [PM-2130] Refining implementation for AutofillCollect
* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)
* add unit tests for urlNotSecure
* add test coverage command
* add unit tests for canSeeElementToStyle
* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false
* add tests for selectAllFromDoc and getElementByOpId
* clean up getElementByOpId
* address some typing issues
* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery
* clean up setValueForElement and setValueForElementByEvent
* more typescript cleanup
* add tests for doClickByOpId and touchAllPasswordFields
* add tests for doFocusByOpId and doClickByQuery
* misc fill cleanup
* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId
* add tests for isKnownTag and isElementVisible
* rename addProp and remove redundant focusElement in favor of doFocusElement
* cleanup
* fix checkNodeType
* add tests for shiftForLeftLabel
* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel
* add tests for getFormElements
* clean up getFormElements
* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc
* clean up and rename queryDoc to queryDocument
* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute
* rebase cleanup
* prettier formatting
* [PM-2130] Fixing linting issues
* [PM-2130] Fixing linting issues
* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context
* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect
* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect
* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport
* [PM-2130] Filling out implementation of autofill-insert
* [PM-2130] Refining AutofillInsert
* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service
* [PM-2130] Fixing jest tests for AutofillCollect
* [PM-2130] Fixing jest tests for AutofillInit
* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect
* [PM-2130] Working through AutofillInsert implementation
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field
* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService
* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService
* [PM-2130] Further organization of implementation
* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method
* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService
* [PM-2130] Further refactoring of elements including typing information
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Organization and refactoring of methods within InsertAutofillContent
* [PM-2130] Implementation of jest tests for InsertAutofillContentService
* [PM-2130] Implementation of Jest Test for IntertAutofillContentService
* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces
* [PM-2130] Cleaning up dead code comments
* [PM-2130] Removing unnecessary constants
* [PM-2130] Finalizing jest tests for InsertAutofillContentService
* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior
* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components
* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility
* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing test test for when we need to handle a password reprompt
---------
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
* [PM-3285] Migrating Changes from PM-1407 into autofill v2 refactor implementation
* [PM-2747] Add Support for Feature Flag of Autofill Version (#5695)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* split up autofill.ts, first pass
* remove modification tracking comments
* lessen and localize eslint disables
* additional typing and formatting
* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)
* update autofill v2 with PR #4155 changes (add autofill support for textarea)
Co-Authored-By: Manuel <mr-manuel@outlook.it>
* move commonly used string values to constants
* ts cleanup
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Starting work to re-architect autofillv2.ts
* [PM-2130] Working through autofill collect method
* [PM-2130] Marking Removal of documentUUID as dead code
* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation
* [PM-2130] Applying small refactors to AutofillCollect
* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method
* [PM-2130] Implementing jest tests for AutofillCollect methods
* [PM-2130] Refining implementation for AutofillCollect
* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)
* add unit tests for urlNotSecure
* add test coverage command
* add unit tests for canSeeElementToStyle
* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false
* add tests for selectAllFromDoc and getElementByOpId
* clean up getElementByOpId
* address some typing issues
* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery
* clean up setValueForElement and setValueForElementByEvent
* more typescript cleanup
* add tests for doClickByOpId and touchAllPasswordFields
* add tests for doFocusByOpId and doClickByQuery
* misc fill cleanup
* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId
* add tests for isKnownTag and isElementVisible
* rename addProp and remove redundant focusElement in favor of doFocusElement
* cleanup
* fix checkNodeType
* add tests for shiftForLeftLabel
* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel
* add tests for getFormElements
* clean up getFormElements
* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc
* clean up and rename queryDoc to queryDocument
* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute
* rebase cleanup
* prettier formatting
* [PM-2130] Fixing linting issues
* [PM-2130] Fixing linting issues
* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context
* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect
* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect
* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport
* [PM-2130] Filling out implementation of autofill-insert
* [PM-2130] Refining AutofillInsert
* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service
* [PM-2130] Fixing jest tests for AutofillCollect
* [PM-2130] Fixing jest tests for AutofillInit
* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect
* [PM-2130] Working through AutofillInsert implementation
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Migrating methods from fill.ts to AutofillInsert
* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field
* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService
* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService
* [PM-2130] Further organization of implementation
* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method
* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService
* [PM-2130] Further refactoring of elements including typing information
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Implementing jest tests for InsertAutofillContentService
* [PM-2130] Organization and refactoring of methods within InsertAutofillContent
* [PM-2130] Implementation of jest tests for InsertAutofillContentService
* [PM-2130] Implementation of Jest Test for IntertAutofillContentService
* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces
* [PM-2130] Cleaning up dead code comments
* [PM-2130] Removing unnecessary constants
* [PM-2130] Finalizing jest tests for InsertAutofillContentService
* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Implementing jest tests for DomElementVisibilityService
* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2130] Adding a comment explaining a fix for Safari
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2747] Add Support for Feature Flag of Autofill Version
* [PM-2747] Adding Support for Manifest v3 within the implementation
* [PM-2747] Modifying how the feature flag for autofill is named
* [PM-2747] Modifying main.background.ts to load the ConfigApiService correctly
* [PM-2747] Refactoring trigger of autofill scripts to be a simple immediately invoked function
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior
* [PM-2747] Modifying how we inject the autofill scripts to ensure we are injecting into all frames within a page
* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components
* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility
* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)
* [PM-2100] Create Unit Test Suite for Autofill.service.ts
* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method
* [PM-2100] Implementing tests for the doAutofill method within the autofill service
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Working through implementation of doAutofill method
* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service
* [PM-2100] Finishing implementation of doAutoFill method within autofill service
* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service
* [PM-2100] Working through tests for generateFillScript
* [PM-2100] Finalizing generateFillScript method testing
* [PM-2100] Starting implementation of generateLoginFillScript
* [PM-2100] Working through tests for generateLoginFillScript
* [PM-2100] Finalizing generateLoginFillScript method testing
* [PM-2100] Removing unnecessary jest config file
* [PM-2100] Fixing jest tests based on changes implemented within PM-2130
* [PM-2100] Fixing autofill mocks
* [PM-2100] Fixing AutofillService jest tests
* [PM-2100] Handling missing tests within coverage of AutofillService
* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript
* [PM-2100] Writing tests for AutofillService.generateCardFillScript
* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript
* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR
* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript
* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript
* [PM-2100] Implementing tests for AutofillService
* [PM-2100] Implementing tests for AutofillService.loadPasswordFields
* [PM-2100] Implementing tests for AutofillService.findUsernameField
* [PM-2100] Implementing tests for AutofillService.findTotpField
* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch
* [PM-2100] Finalizing tests for AutofillService
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Modyfing placement of autofill-mocks
* [PM-2100] Removal of jest transform declaration
* [PM-2747] Applying a fix for a race condition that can occur when loading the notification bar and autofiller script login
* [PM-2747] Reverting removal of autofill npm action. Now this will force usage of autofill-v2 regardless of whether a feature flag is set or not
* [PM-2747] Fixing logic error incorporated when merging in master
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2130] Fixing issue with autofill service unit tests
* [PM-2747] Fixing issue present with notification bar merge
* [PM-2130] Fixing test test for when we need to handle a password reprompt
* [PM-2747] Fixing wording for webpack script
* [PM-2747] Addressing stylistic changes requested from code review
* [PM-2747] Addressing stylistic changes requested from code review
---------
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
* [PM-3285] Applying stylistic changes suggested by code review for the feature flag implementation
* [PM-3285] Adding temporary console log to validate which version is being used
* [PM-3285] Removing temporary console log indicating which version of autofill the user is currently loading
---------
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2023-09-07 22:33:04 +02:00
|
|
|
"content/trigger-autofill-script-injection":
|
|
|
|
"./src/autofill/content/trigger-autofill-script-injection.ts",
|
|
|
|
"content/autofill": "./src/autofill/content/autofill.js",
|
|
|
|
"content/autofill-init": "./src/autofill/content/autofill-init.ts",
|
2023-01-31 22:08:37 +01:00
|
|
|
"content/autofiller": "./src/autofill/content/autofiller.ts",
|
|
|
|
"content/notificationBar": "./src/autofill/content/notification-bar.ts",
|
|
|
|
"content/contextMenuHandler": "./src/autofill/content/context-menu-handler.ts",
|
|
|
|
"content/message_handler": "./src/autofill/content/message_handler.ts",
|
2023-03-08 23:12:43 +01:00
|
|
|
"notification/bar": "./src/autofill/notification/bar.ts",
|
2023-06-06 22:34:53 +02:00
|
|
|
"encrypt-worker": "../../libs/common/src/platform/services/cryptography/encrypt.worker.ts",
|
2018-04-04 04:14:54 +02:00
|
|
|
},
|
2018-09-12 05:54:39 +02:00
|
|
|
optimization: {
|
2022-06-27 19:38:12 +02:00
|
|
|
minimize: ENV !== "development",
|
2022-02-14 15:06:14 +01:00
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
2022-02-15 15:09:02 +01:00
|
|
|
exclude: [/content\/.*/, /notification\/.*/],
|
2022-03-22 09:58:17 +01:00
|
|
|
terserOptions: {
|
|
|
|
// Replicate Angular CLI behaviour
|
|
|
|
compress: {
|
|
|
|
global_defs: {
|
|
|
|
ngDevMode: false,
|
|
|
|
ngI18nClosureMode: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-02-14 15:06:14 +01:00
|
|
|
}),
|
|
|
|
],
|
2018-09-12 05:54:39 +02:00
|
|
|
splitChunks: {
|
|
|
|
cacheGroups: {
|
|
|
|
commons: {
|
2020-09-15 22:13:07 +02:00
|
|
|
test(module, chunks) {
|
|
|
|
return (
|
|
|
|
module.resource != null &&
|
|
|
|
module.resource.includes(`${path.sep}node_modules${path.sep}`) &&
|
|
|
|
!module.resource.includes(`${path.sep}node_modules${path.sep}@angular${path.sep}`)
|
|
|
|
);
|
|
|
|
},
|
|
|
|
name: "popup/vendor",
|
|
|
|
chunks: (chunk) => {
|
|
|
|
return chunk.name === "popup/main";
|
2018-09-12 05:54:39 +02:00
|
|
|
},
|
|
|
|
},
|
2018-04-06 23:02:46 +02:00
|
|
|
angular: {
|
2020-09-15 22:13:07 +02:00
|
|
|
test(module, chunks) {
|
2018-04-06 23:02:46 +02:00
|
|
|
return (
|
|
|
|
module.resource != null &&
|
2018-04-07 06:24:37 +02:00
|
|
|
module.resource.includes(`${path.sep}node_modules${path.sep}@angular${path.sep}`)
|
2021-12-21 15:43:35 +01:00
|
|
|
);
|
|
|
|
},
|
2018-04-07 06:24:37 +02:00
|
|
|
name: "popup/vendor-angular",
|
|
|
|
chunks: (chunk) => {
|
2018-09-12 05:54:39 +02:00
|
|
|
return chunk.name === "popup/main";
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-04-06 23:02:46 +02:00
|
|
|
},
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
2018-04-06 23:02:46 +02:00
|
|
|
resolve: {
|
|
|
|
extensions: [".ts", ".js"],
|
|
|
|
symlinks: false,
|
2022-06-02 15:18:29 +02:00
|
|
|
modules: [path.resolve("../../node_modules")],
|
2022-03-15 13:13:39 +01:00
|
|
|
alias: {
|
|
|
|
sweetalert2: require.resolve("sweetalert2/dist/sweetalert2.js"),
|
|
|
|
"#sweetalert2": require.resolve("sweetalert2/src/sweetalert2.scss"),
|
|
|
|
},
|
2021-12-21 15:43:35 +01:00
|
|
|
fallback: {
|
2018-04-11 03:54:20 +02:00
|
|
|
assert: false,
|
|
|
|
buffer: require.resolve("buffer/"),
|
|
|
|
util: require.resolve("util/"),
|
2021-12-09 21:08:34 +01:00
|
|
|
url: require.resolve("url/"),
|
2023-01-26 15:20:12 +01:00
|
|
|
fs: false,
|
2023-02-03 20:24:49 +01:00
|
|
|
path: require.resolve("path-browserify"),
|
2018-04-06 23:02:46 +02:00
|
|
|
},
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
|
|
|
output: {
|
2021-12-09 21:08:34 +01:00
|
|
|
filename: "[name].js",
|
2018-04-11 03:54:20 +02:00
|
|
|
path: path.resolve(__dirname, "build"),
|
2021-12-21 15:43:35 +01:00
|
|
|
},
|
2023-01-26 15:20:12 +01:00
|
|
|
module: {
|
|
|
|
noParse: /\.wasm$/,
|
|
|
|
rules: moduleRules,
|
|
|
|
},
|
2018-04-13 22:03:37 +02:00
|
|
|
plugins: plugins,
|
2018-04-04 04:14:54 +02:00
|
|
|
};
|
2018-04-07 06:24:37 +02:00
|
|
|
|
2022-11-17 21:15:34 +01:00
|
|
|
/**
|
|
|
|
* @type {import("webpack").Configuration[]}
|
|
|
|
*/
|
|
|
|
const configs = [];
|
|
|
|
|
2022-08-10 03:30:26 +02:00
|
|
|
if (manifestVersion == 2) {
|
2022-11-17 21:15:34 +01:00
|
|
|
mainConfig.optimization.splitChunks.cacheGroups.commons2 = {
|
2022-08-10 03:30:26 +02:00
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
|
name: "vendor",
|
|
|
|
chunks: (chunk) => {
|
|
|
|
return chunk.name === "background";
|
|
|
|
},
|
|
|
|
};
|
2022-11-17 21:15:34 +01:00
|
|
|
|
|
|
|
// Manifest V2 uses Background Pages which requires a html page.
|
|
|
|
mainConfig.plugins.push(
|
|
|
|
new HtmlWebpackPlugin({
|
2023-06-06 22:34:53 +02:00
|
|
|
template: "./src/platform/background.html",
|
2022-11-17 21:15:34 +01:00
|
|
|
filename: "background.html",
|
|
|
|
chunks: ["vendor", "background"],
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
// Manifest V2 background pages can be run through the regular build pipeline.
|
|
|
|
// Since it's a standard webpage.
|
2023-06-06 22:34:53 +02:00
|
|
|
mainConfig.entry.background = "./src/platform/background.ts";
|
2022-11-17 21:15:34 +01:00
|
|
|
|
|
|
|
configs.push(mainConfig);
|
2022-10-18 19:03:09 +02:00
|
|
|
} else {
|
2022-11-17 21:15:34 +01:00
|
|
|
// Manifest v3 needs an extra helper for utilities in the content script.
|
|
|
|
// The javascript output of this should be added to manifest.v3.json
|
2023-01-31 22:08:37 +01:00
|
|
|
mainConfig.entry["content/misc-utils"] = "./src/autofill/content/misc-utils.ts";
|
2022-11-17 21:15:34 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {import("webpack").Configuration}
|
|
|
|
*/
|
|
|
|
const backgroundConfig = {
|
|
|
|
name: "background",
|
|
|
|
mode: ENV,
|
|
|
|
devtool: false,
|
2023-06-06 22:34:53 +02:00
|
|
|
entry: "./src/platform/background.ts",
|
2022-11-17 21:15:34 +01:00
|
|
|
target: "webworker",
|
|
|
|
output: {
|
|
|
|
filename: "background.js",
|
|
|
|
path: path.resolve(__dirname, "build"),
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: "ts-loader",
|
|
|
|
},
|
2023-01-26 15:20:12 +01:00
|
|
|
{
|
|
|
|
test: /\.wasm$/,
|
|
|
|
loader: "base64-loader",
|
|
|
|
type: "javascript/auto",
|
|
|
|
},
|
2022-11-17 21:15:34 +01:00
|
|
|
],
|
2023-01-26 15:20:12 +01:00
|
|
|
noParse: /\.wasm$/,
|
2022-11-17 21:15:34 +01:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [".ts", ".js"],
|
|
|
|
symlinks: false,
|
|
|
|
modules: [path.resolve("../../node_modules")],
|
|
|
|
plugins: [new TsconfigPathsPlugin()],
|
2023-01-26 15:20:12 +01:00
|
|
|
fallback: {
|
|
|
|
fs: false,
|
|
|
|
path: false,
|
|
|
|
},
|
2022-11-17 21:15:34 +01:00
|
|
|
},
|
|
|
|
dependencies: ["main"],
|
|
|
|
plugins: [...requiredPlugins],
|
|
|
|
};
|
|
|
|
|
|
|
|
configs.push(mainConfig);
|
|
|
|
configs.push(backgroundConfig);
|
2022-08-10 03:30:26 +02:00
|
|
|
}
|
|
|
|
|
2022-11-17 21:15:34 +01:00
|
|
|
module.exports = configs;
|