diff --git a/debug/iframe-blob.html b/debug/iframe-blob.html
new file mode 100644
index 00000000000..d9d9b5e7074
--- /dev/null
+++ b/debug/iframe-blob.html
@@ -0,0 +1,54 @@
+
+
+
+ Mapbox GL JS debug page
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/debug/iframe.html b/debug/iframe.html
new file mode 100644
index 00000000000..6e4fe349fac
--- /dev/null
+++ b/debug/iframe.html
@@ -0,0 +1,14 @@
+
+
+
+ Mapbox GL JS debug page
+
+
+
+
+
+
+
+
+
+
diff --git a/src/util/ajax.js b/src/util/ajax.js
index 61853f8ef29..cf947949cea 100644
--- a/src/util/ajax.js
+++ b/src/util/ajax.js
@@ -84,12 +84,7 @@ function isWorker() {
/* global self, WorkerGlobalScope */
export const getReferrer = isWorker() ?
() => self.worker && self.worker.referrer :
- () => {
- const origin = window.location.origin;
- if (origin && origin !== 'null' && origin !== 'file://') {
- return origin + window.location.pathname;
- }
- };
+ () => (location.protocol === 'blob:' ? parent : window).location.href;
function makeFetchRequest(requestParameters: RequestParameters, callback: ResponseCallback): Cancelable {
const controller = new window.AbortController();