Automattic / Automattic/jetpack

Notifications: load WP.com tracking pixel with crossorigin attribute

Open
#19,411 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Notifications [Pri] Normal Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

For the [Web Stories WordPress plugin](https://wordpress.org/plugins/web-stories/) we set [cross-origin isolation](https://web.dev/coop-coep/) on some admin pages, which requires loading 3P resources with the `crossorigin` attribute.

If not done, loading these resources will fail with console errors. This is the case for the Notifications module. And potentially others as well.

1. Activate [Web Stories for WordPress](https://wordpress.org/plugins/web-stories/)
2. Activate Notifications module
3. Go to Stories -> My Stories or Stories -> Add New
4. Check console errors

#### What I expected

The tracking pixel should be loading just fine, no console errors.

For this, the `` needs to be loaded with the `crossorigin` attribute.

The image itself should have a `Access-Control-Allow-Origin: *` response header.

#### What happened instead

See console error because tracking pixel is not loaded with `crossorigin` attribute

**Screenshots**
If applicable, add screenshots to help explain your problem.

Screenshot 2021-04-04 at 16 30 15

Contributor guide

Open the contributing guide

Research direction

Start in the Notifications module and locate the WP.com tracking-pixel used on the affected admin pages. Reproduce with Web Stories enabled, inspect the browser console, and confirm the image request uses the crossorigin attribute and succeeds with the required CORS response header.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.