Skip to content

Commit bb42bea

Browse files
authored
fix(google-maps,gravatar): a11y misc fixes (#802)
1 parent 33a113a commit bb42bea

5 files changed

Lines changed: 11 additions & 4 deletions

File tree

docs/content/docs/1.guides/2.first-party.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Route third-party script traffic through a reverse proxy on your do
55

66
## The Problem
77

8-
Every third-party script your site loads connects your users directly to external servers. Each request shares the user's IP address, and many scripts go further: the X Pixel accesses 9 browser fingerprinting APIs (including `navigator.getBattery()`{lang="ts"}), sets 5 tracking cookies (`muc_ads`, `guest_id_marketing`, `guest_id_ads`, `personalization_id`, `guest_id`), and phones home to 3 separate domains. Microsoft Clarity reads 10 fingerprinting APIs across 3 domains. Even Google Analytics at 154 KB sends data that can be correlated across sites.
8+
Every third-party script your site loads connects your users directly to external servers. Each request shares the user's IP address, and many scripts go further: the X Pixel accesses 4 browser fingerprinting APIs (including `navigator.getBattery()`{lang="ts"}), sets 5 tracking cookies (`muc_ads`, `guest_id_marketing`, `guest_id_ads`, `personalization_id`, `guest_id`), and phones home to 3 separate domains. Microsoft Clarity reads 5 fingerprinting APIs across 3 domains. Even Google Analytics at 154 KB sends data that can be correlated across sites.
99

1010
Ad blockers rightfully block these requests, which breaks analytics for sites that depend on them.
1111

docs/content/docs/5.releases/1.v1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Nuxt Scripts v1 is the first stable release, pushing the ecosystem forward for b
1111

1212
Every third-party script request exposes your users data to [fingerprinting](https://firstpartysimulator.net/learn).
1313

14-
Different providers are more intrusive, for example, the X Pixel accesses 9 browser fingerprinting APIs (including `navigator.getBattery()`{lang="ts"}), sets 5 tracking cookies, and makes requests to 3 separate domains. Microsoft Clarity reads 10 fingerprinting APIs across 3 domains.
14+
Different providers are more intrusive, for example, the X Pixel accesses 4 browser fingerprinting APIs (including `navigator.getBattery()`{lang="ts"}), sets 5 tracking cookies, and makes requests to 3 separate domains. Microsoft Clarity reads 5 fingerprinting APIs across 3 domains.
1515

1616
First-party mode acts as a **reverse proxy**: Nuxt bundles scripts at build time and serves them from your domain, while runtime requests are securely forwarded through your server. Data sent to third-party servers gets anonymised: IPs (`180.233.124.74` -> `180.233.124.0`), browser versions (`Mozilla/5.0 (compatible; Chrome/120.0)`{lang="ts"}) and more. This is **auto-enabled** for all scripts that support it.
1717

packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,18 @@ const props = withDefaults(defineProps<{
9999
* Additional attributes for the `<img>` element.
100100
*/
101101
imgAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>
102+
/**
103+
* Alt text for the map image. Override to provide a more descriptive label for screen readers.
104+
*/
105+
alt?: string
102106
}>(), {
103107
zoom: 15,
104108
scale: 2,
105109
loading: 'lazy',
106110
objectFit: 'cover',
107111
width: 640,
108112
height: 400,
113+
alt: 'Google Maps',
109114
})
110115
111116
defineSlots<{
@@ -232,7 +237,7 @@ const src = computed(() => {
232237
const imgAttributes = computed(() => {
233238
return defu(props.imgAttrs, {
234239
src: src.value,
235-
alt: 'Google Maps',
240+
alt: props.alt,
236241
loading: props.loading,
237242
style: {
238243
width: '100%',

packages/script/src/runtime/components/ScriptGravatar.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ onMounted(() => {
5858
>
5959
<span
6060
v-else
61+
role="status"
62+
aria-label="Loading avatar"
6163
:style="{ display: 'inline-block', width: `${size}px`, height: `${size}px`, borderRadius: '50%', background: '#e0e0e0' }"
6264
/>
6365
</template>

packages/script/src/runtime/components/ScriptLoadingIndicator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const styles = computed(() => ({
1616
</script>
1717

1818
<template>
19-
<div class="loader" :styles="styles" aria-label="Loading..." role="status" />
19+
<div class="loader" :style="styles" aria-label="Loading..." role="status" />
2020
</template>
2121

2222
<style scoped>

0 commit comments

Comments
 (0)