* Skip to main content 
  * Skip to search 
  * Skip to select language 

[ MDN Web Docs  ](/en-US/) Open main menu

  * References  [ References ](/en-US/docs/Web)
    * [ Overview / Web Technology  Web technology reference for developers  ](/en-US/docs/Web)
    * [ HTML  Structure of content on the web  ](/en-US/docs/Web/HTML)
    * [ CSS  Code used to describe document style  ](/en-US/docs/Web/CSS)
    * [ JavaScript  General-purpose scripting language  ](/en-US/docs/Web/JavaScript)
    * [ HTTP  Protocol for transmitting web resources  ](/en-US/docs/Web/HTTP)
    * [ Web APIs  Interfaces for building web applications  ](/en-US/docs/Web/API)
    * [ Web Extensions  Developing extensions for web browsers  ](/en-US/docs/Mozilla/Add-ons/WebExtensions)
    * [ Web Technology  Web technology reference for developers  ](/en-US/docs/Web)
  * Guides  [ Guides ](/en-US/docs/Learn)
    * [ Overview / MDN Learning Area  Learn web development  ](/en-US/docs/Learn)
    * [ MDN Learning Area  Learn web development  ](/en-US/docs/Learn)
    * [ HTML  Learn to structure web content with HTML  ](/en-US/docs/Learn/HTML)
    * [ CSS  Learn to style content using CSS  ](/en-US/docs/Learn/CSS)
    * [ JavaScript  Learn to run scripts in the browser  ](/en-US/docs/Learn/JavaScript)
    * [ Accessibility  Learn to make the web accessible to all  ](/en-US/docs/Web/Accessibility)
  * Plus  [ Plus ](/en-US/plus)
    * [ Overview  A customized MDN experience  ](/en-US/plus)
    * [ AI Help (beta)  Get real-time assistance and support  ](/en-US/plus/ai-help)
    * [ Updates  All browser compatibility updates at a glance  ](/en-US/plus/updates)
    * [ Documentation  Learn how to use MDN Plus  ](/en-US/plus/docs/features/overview)
    * [ FAQ  Frequently asked questions about MDN Plus  ](/en-US/plus/docs/faq)
  * [ Curriculum  New  ](/en-US/curriculum/)
  * [ Blog ](/en-US/blog/)
  * [ Play ](/en-US/play)
  * [ AI Help  Beta  ](/en-US/plus/ai-help)

Search MDN  Clear search input  Search

Theme

  * [ Log in ](/users/fxa/login/authenticate/?next=%2Fen-US%2Fdocs%2FWeb%2FAPI%2FFetch_API%2FCross-global_fetch_usage)
  * [ Sign up for free  ](/users/fxa/login/authenticate/?next=%2Fen-US%2Fdocs%2FWeb%2FAPI%2FFetch_API%2FCross-global_fetch_usage)

  1. [ References  ](/en-US/docs/Web)
  2. [ Web APIs  ](/en-US/docs/Web/API)
  3. [ Fetch API  ](/en-US/docs/Web/API/Fetch_API)
  4. [ Cross-global fetch usage  ](/en-US/docs/Web/API/Fetch_API/Cross-global_fetch_usage)

Article Actions

  * English (US) 

Filter sidebar  Clear filter input

##  In this article

  * The edge case 
  * The problem 
  * The solution 

  1. **[ Fetch API ](/en-US/docs/Web/API/Fetch_API) **
  2. Guides 
    1. [ Using the Fetch API ](/en-US/docs/Web/API/Fetch_API/Using_Fetch)
    2. [ Fetch basic concepts ](/en-US/docs/Web/API/Fetch_API/Basic_concepts)
    3. _[ Cross-global fetch usage ](/en-US/docs/Web/API/Fetch_API/Cross-global_fetch_usage) _
  3. Interfaces 
    1. [ ` Headers ` ](/en-US/docs/Web/API/Headers)
    2. [ ` Request ` ](/en-US/docs/Web/API/Request)
    3. [ ` Response ` ](/en-US/docs/Web/API/Response)
  4. Methods 
    1. [ ` fetch() ` ](/en-US/docs/Web/API/fetch)

##  In this article

  * The edge case 
  * The problem 
  * The solution 

#  Cross-global fetch usage

This article explains an edge case that occurs with fetch (and potentially
other APIs exhibiting the same kind of resource retrieval behavior). When a
cross-origin fetch involving a relative URL is initiated from an [ ` <iframe>
` ](/en-US/docs/Web/HTML/Element/iframe) , the relative URL used to be
resolved against the current global location, rather than the iframe's
location.

##  The edge case

Many sites will never come up against this edge case. To see it:

  * You need a same-origin iframe 
  * That same-origin iframe needs to have a location with a different base URL 
  * You have to use the fetch function cross-global, e.g. ` frame.contentWindow.fetch() `
  * The URL passed to fetch needs to be re