Skip to content

Commit

Permalink
fix: Do not show inline menu in Cozy Drive and Photos
Browse files Browse the repository at this point in the history
It was displayed for example in sharing modals and album creation
modal where it has no interest at all.
  • Loading branch information
zatteo committed Nov 28, 2024
1 parent 42aa9a5 commit 7eda6a0
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function getAppURLCozy(cozyUrl: string, appName: string, hash: string, nested: b
let cozyPasswordsHostnames: string[] = [];
let cozyContactsHostnames: string[] = [];
let cozyMespapiersHostnames: string[] = [];
let cozyDriveHostnames: string[] = [];
let cozyPhotosHostnames: string[] = [];

chrome.storage.local.get("global_environment_environment", (response) => {
const storedValue = response?.global_environment_environment?.value;
Expand All @@ -85,6 +87,14 @@ chrome.storage.local.get("global_environment_environment", (response) => {
new URL(getAppURLCozy(parsedValue.urls.base, "mespapiers", "", true)).hostname,
new URL(getAppURLCozy(parsedValue.urls.base, "mespapiers", "", false)).hostname,
];
cozyDriveHostnames = [
new URL(getAppURLCozy(parsedValue.urls.base, "drive", "", true)).hostname,
new URL(getAppURLCozy(parsedValue.urls.base, "drive", "", false)).hostname,
];
cozyPhotosHostnames = [
new URL(getAppURLCozy(parsedValue.urls.base, "photos", "", true)).hostname,
new URL(getAppURLCozy(parsedValue.urls.base, "photos", "", false)).hostname,
];
}
});
// Cozy customization end
Expand Down Expand Up @@ -1221,6 +1231,14 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
return true;
}

if (cozyDriveHostnames.find((hostname) => hostname === url.hostname)) {
return true;
}

if (cozyPhotosHostnames.find((hostname) => hostname === url.hostname)) {
return true;
}

return false;
} catch {
// do nothing is new URL is invalid
Expand Down

0 comments on commit 7eda6a0

Please sign in to comment.