SharePoint / SharePoint/sp-dev-docs
With an Event Listener for navigatedEvent - Network tab thinks all requests are being made by my code
@Amey-MSFT is already working on this.
Since May 6, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
Latest SPFx build
Describe the bug / error
In my Application Customiser I am using the navigatedEvent event listener in order to enable my customiser to fire on page navigation events which do not cause a full page reload.
this.context.application.navigatedEvent.add(this, async () => { /* customiser code goes here */ });
However, when I am inspecting the Network tab in DevTools it APPEARS as though my app customiser is causing dozens of requests.
On inspection of these requests, they are actually being made by SharePoint Online itself - and for some reason my app customiser is being references as the "Source"
This is a particular issue for clients who are suggesting that my app customizer is the cause of performance problems on their site.
An example screenshot of the network tab is shown below:
Many of these requests are "out of the box" SharePoint async page requests - for things like page tracking, logging activity, and various notification checks being made by the page.
Note - yes, I know the name of the JS file is "webpart" but trust me, this is actually an app customiser. Don't ask!
Steps to reproduce
- Create a new SPFx Application Customiser
- Use the following snippet in your onInit() method:
this.context.application.navigatedEvent.add(this, async () => { /* customiser code goes here */ }); - Deploy your package and check the Network Tab in Dev Tools
Expected behavior
When using the navigatedEvent event listener in my SPFx application, only requests made by my own code are referred to in Dev Tools as being requested by my code.
My code should not be listed as the "source" for out of the box SharePoint requests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.