diff --git a/.gitmodules b/.gitmodules index 7dba9bf5a..15720643d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "Sources/BrowserServicesKit/Resources/duckduckgo-autofill"] - path = Sources/BrowserServicesKit/Resources/duckduckgo-autofill - url = https://github.com/duckduckgo/duckduckgo-autofill [submodule "Sources/BrowserServicesKit/Resources/content-scope-scripts"] path = Sources/BrowserServicesKit/Resources/content-scope-scripts url = https://github.com/duckduckgo/content-scope-scripts diff --git a/Package.swift b/Package.swift index 851cd0ea8..13445297b 100644 --- a/Package.swift +++ b/Package.swift @@ -14,6 +14,7 @@ let package = Package( .library(name: "BrowserServicesKit", targets: ["BrowserServicesKit"]) ], dependencies: [ + .package(name: "Autofill", url: "https://github.com/duckduckgo/duckduckgo-autofill.git", .exact("4.4.0")), .package(name: "GRDB", url: "https://github.com/duckduckgo/GRDB.swift.git", .exact("1.1.0")), .package(url: "https://github.com/duckduckgo/TrackerRadarKit", .exact("1.0.3")), .package(name: "Punycode", url: "https://github.com/gumob/PunycodeSwift.git", .exact("2.1.0")) @@ -23,6 +24,7 @@ let package = Package( .target( name: "BrowserServicesKit", dependencies: [ + "Autofill", "GRDB", "TrackerRadarKit", .product(name: "Punnycode", package: "Punycode"), @@ -41,31 +43,9 @@ let package = Package( "Resources/content-scope-scripts/lib/", "Resources/content-scope-scripts/build/chrome/", "Resources/content-scope-scripts/build/firefox/", - "Resources/content-scope-scripts/build/integration/", - "Resources/duckduckgo-autofill/Gruntfile.js", - "Resources/duckduckgo-autofill/package.json", - "Resources/duckduckgo-autofill/package-lock.json", - "Resources/duckduckgo-autofill/packages/", - "Resources/duckduckgo-autofill/integration-test/", - "Resources/duckduckgo-autofill/LICENSE.md", - "Resources/duckduckgo-autofill/README.md", - "Resources/duckduckgo-autofill/src", - "Resources/duckduckgo-autofill/dist/autofill-host-styles_firefox.css", - "Resources/duckduckgo-autofill/dist/autofill.css", - "Resources/duckduckgo-autofill/jest.setup.js", - "Resources/duckduckgo-autofill/dist/autofill-host-styles_chrome.css", - "Resources/duckduckgo-autofill/jest.config.js", - "Resources/duckduckgo-autofill/jest-test-environment.js", - "Resources/duckduckgo-autofill/scripts/", - "Resources/duckduckgo-autofill/jesthtmlreporter.config.json", - "Resources/duckduckgo-autofill/types.d.ts", - "Resources/duckduckgo-autofill/tsconfig.json", - "Resources/duckduckgo-autofill/docs/real-world-html-tests.md", - "Resources/duckduckgo-autofill/docs/matcher-configuration.md" + "Resources/content-scope-scripts/build/integration/" ], resources: [ - .process("Resources/duckduckgo-autofill/dist/autofill.js"), - .process("Resources/duckduckgo-autofill/dist/TopAutofill.html"), .process("ContentBlocking/UserScripts/contentblockerrules.js"), .process("ContentBlocking/UserScripts/surrogates.js"), .process("Resources/content-scope-scripts/build/apple/contentScope.js") diff --git a/Sources/BrowserServicesKit/Autofill/AutofillUserScript+SourceProvider.swift b/Sources/BrowserServicesKit/Autofill/AutofillUserScript+SourceProvider.swift index 0f19f7863..b59bccdc5 100644 --- a/Sources/BrowserServicesKit/Autofill/AutofillUserScript+SourceProvider.swift +++ b/Sources/BrowserServicesKit/Autofill/AutofillUserScript+SourceProvider.swift @@ -18,6 +18,7 @@ // import Foundation +import Autofill public protocol AutofillUserScriptSourceProvider { var source: String { get } @@ -58,6 +59,6 @@ public class DefaultAutofillSourceProvider: AutofillUserScriptSourceProvider { replacements["// INJECT userUnprotectedDomains HERE"] = "userUnprotectedDomains = " + userUnprotectedDomainsString + ";" replacements["// INJECT userPreferences HERE"] = "userPreferences = " + jsonPropertiesString + ";" - sourceStr = AutofillUserScript.loadJS("autofill", from: Bundle.module, withReplacements: replacements) + sourceStr = AutofillUserScript.loadJS("assets/autofill", from: Autofill.bundle, withReplacements: replacements) } } diff --git a/Sources/BrowserServicesKit/Resources/duckduckgo-autofill b/Sources/BrowserServicesKit/Resources/duckduckgo-autofill deleted file mode 160000 index dd9165ab9..000000000 --- a/Sources/BrowserServicesKit/Resources/duckduckgo-autofill +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dd9165ab903eb22894a67bafaa7365a31e208906