Skip to content

[Password Import, Android] Create password-import (isolated) bundle for android #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
"build-chrome": "node scripts/inject.js --platform chrome",
"build-chrome-mv3": "node scripts/inject.js --platform chrome-mv3",
"build-apple": "node scripts/inject.js --platform apple && node scripts/inject.js --platform apple-isolated",
"build-android-for-frames": "node scripts/inject.js --platform android-for-frames --for-frames",
"build-android": "node scripts/inject.js --platform android",
"build-windows": "node scripts/inject.js --platform windows",
"build-integration": "node scripts/inject.js --platform integration",
4 changes: 4 additions & 0 deletions scripts/inject.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,10 @@ const builds = {
input: 'inject/apple.js',
output: ['Sources/ContentScopeScripts/dist/contentScopeIsolated.js']
},
'android-for-frames': {
input: 'inject/android.js',
output: ['Sources/ContentScopeScripts/dist/androidForFrames.js']
},
android: {
input: 'inject/android.js',
output: ['build/android/contentScope.js']
4 changes: 4 additions & 0 deletions src/features.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ const baseFeatures = /** @type {const} */([
'fingerprintingBattery',
'fingerprintingCanvas',
'googleRejected',
'googlePasswordImport',
'gpc',
'fingerprintingHardware',
'referrer',
@@ -39,6 +40,9 @@ export const platformSupport = {
'performanceMetrics',
'clickToLoad'
],
'android-for-frames': [
'googlePasswordImport'
],
android: [
...baseFeatures,
'webCompat',
32 changes: 32 additions & 0 deletions src/features/google-password-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ContentFeature from '../content-feature'
import { getElement } from './broker-protection/utils';

export default class GooglePasswordImport extends ContentFeature {
init () {
document.addEventListener('DOMContentLoaded', (event) => {
var xpath = "//div[text()='Export passwords']/ancestor::li"; // Should be configurable
const exportElement = getElement(document, xpath);
if (exportElement) {
exportElement.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
}); // Scroll into view
var keyframes = [
{ backgroundColor: 'transparent' },
{ backgroundColor: 'lightblue' },
{ backgroundColor: 'transparent' },
];

// Define the animation options
var options = {
duration: 1000, // 1 seconds, should be configurable
iterations: 3 // Max 3 blinks, should be configurable
};

// Apply the animation to the element
exportElement.animate(keyframes, options);
}
});
}
}
2 changes: 1 addition & 1 deletion src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ interface ImportMeta {
env: 'production' | 'development'
platform?: 'windows' | 'macos' | 'android' | 'ios'
// this represents the different build artifact names
injectName?: 'firefox' | 'apple' | 'apple-isolated' | 'android' | 'windows' | 'integration' | 'chrome-mv3' | 'chrome'
injectName?: 'firefox' | 'apple' | 'apple-isolated' | 'android' | 'android-for-frames' | 'windows' | 'integration' | 'chrome-mv3' | 'chrome'
trackerLookup?: Record<string, unknown>
pageName?: string
}