Skip to content
Open
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
1 change: 0 additions & 1 deletion core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
<link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
<link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
<?php emit_css_loading_tags($_); ?>
Expand Down
1 change: 0 additions & 1 deletion core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
<link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
<link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
<?php emit_css_loading_tags($_); ?>
Expand Down
39 changes: 39 additions & 0 deletions tests/playwright/e2e/core/page-head.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { expect } from '@playwright/test'
import { test as publicTest } from '../../support/fixtures/public-share-page.ts'
import { test as userTest } from '../../support/fixtures/random-user-session.ts'
import { uploadContent } from '../../support/utils/dav.ts'
import { createLinkShare } from '../../support/utils/sharing.ts'

/**
* The page `<head>` must declare each icon exactly once: browsers pick the last
* matching `rel`, so a duplicate `apple-touch-icon-precomposed` silently
* overrides the modern `apple-touch-icon`.
*/

userTest.describe('core: page head', () => {
userTest('user layout emits a single apple-touch-icon', async ({ page }) => {
await page.goto('apps/files')

await expect(page.locator('head link[rel="apple-touch-icon"]')).toHaveCount(1)
await expect(page.locator('head link[rel="apple-touch-icon-precomposed"]')).toHaveCount(0)
await expect(page.locator('head link[rel="mask-icon"]')).toHaveCount(1)
})
})

publicTest.describe('core: page head', () => {
publicTest('public layout emits a single apple-touch-icon', async ({ page, user, ownerRequest, publicShare }) => {
await uploadContent(ownerRequest, user, '<content>head</content>', 'text/plain', '/head-check.txt')
const share = await createLinkShare(ownerRequest, '/head-check.txt')

await publicShare.open(share.url)

await expect(page.locator('head link[rel="apple-touch-icon"]')).toHaveCount(1)
await expect(page.locator('head link[rel="apple-touch-icon-precomposed"]')).toHaveCount(0)
await expect(page.locator('head link[rel="mask-icon"]')).toHaveCount(1)
})
})
Loading