# Narrative Web/ Openstreeetmap referer

**URL:** <https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958>\
**Category:** Help\
**Created:** [September 8, 2026, 11:47am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958 "2026-09-08T11:47:15Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![pgerlier](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@pgerlier](https://gramps.discourse.group/u/pgerlier)\
**Post date:** [September 13, 2026, 11:53am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/21 "2026-09-13T11:53:28Z")

</div>

I had a quick look at the code (_gramps/gramps/plugins/webreport/place.py_) and generated HTML.

The map is contained in a `<div id="map_canvas"></div>` which is just a placeholder to be manipulated by JavaScript. I thought I could trick the `GET` request by adding a “simple” `Referer:https://localhost` header. Unfortunately, I don’t understand what the script does. This probably needs learning both the canvas feature and OpenLayers API.

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 13, 2026, 1:00pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/22 "2026-09-13T13:00:01Z")

</div>

Thanks Patrick  
I have also had a brief look at this with tentative questions to Claude  
and Perplexity both came back with responses that would require an  
expert programmer to interpret not the dumb tweaker that I am.  
So for the moment I have no use for the Narrative Web Report because the  
Places and Heatmaps were becoming more and more important especially  
when showing to others.  
phil

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 16, 2026, 1:00pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/23 "2026-09-16T13:00:28Z")

</div>

Just had this from Openstreet, not had time to investigate but was wondering if it made sense to anybody before I try playing

phil

```python
This is now fixed in GOL Tool 2.3.7 ([download](https://www.geodesk.com/download)) and GeoDesk for Python 2.2.5 (`pip install geodesk -U`). Thanks for your patience!

- `X-Requested-With` headers are *only* sent for the default map (OSM Carto). If you're setting a custom basemap, these headers are not sent (to avoid problems with tileservers that don't understand them)

```

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [September 16, 2026, 1:19pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/24 "2026-09-16T13:19:34Z")

</div>

Bottom line… I just checked my site on the hard drive and the maps are displaying the 403 error. Unless this changes, I’ll assume this OSM “fix” does not apply to our usage.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [September 16, 2026, 1:33pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/25 "2026-09-16T13:33:21Z")

</div>

But curiously, the same local website on an android tablet does display the map. I had to add Simple HTTP Server to the tablet. Chrome would not open a file stored on the tablet.

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 16, 2026, 1:38pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/26 "2026-09-16T13:38:55Z")

</div>

Hi Dave agreed suspect it is a change in the way the map tiles are  
produced so that the referer header is not required so not sure if  
Narrative Web needs modified or some element of python needs added or  
upgraded or both.  
phil

---

<div class="post-metadata">

**Author:** ![jackdlail](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jackdlail](https://gramps.discourse.group/u/jackdlail)\
**Post date:** [September 16, 2026, 4:16pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/27 "2026-09-16T16:16:03Z")

</div>

I also ran into this issue where interactive OpenStreetMaps maps fail to render (well, are blocked from rendering) on a static site when viewed from a local drive or USB flash drive with the `file:///` protocol, while working fine when served via a local web server, `http://localhost`.

If I were generating the static site for just myself, I would just use localhost, but I’m trying to share my research with less techie family members.

A workaround I ended up with is post-processing the generated HTML files to swap the default OSM tile URL with **ESRI’s World Topo** tile service: `[https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/](https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/){z}/{y}/{x}`

Gemini wrote a script to post-process greatgramps static files to add maps back in using ERSI maps. I would think this would be possible with Narrated Web Site files, but I haven’t done it.

Unlike OSM, ESRI does not enforce strict `Referer` checks on these public basemap tiles, nor does it require an API key or display watermarks (unlike CARTO). A Python script or `sed` command running across the generated HTML directory to replace the tile URL restores working maps for completely portable, offline USB distribution.

(I also have a Gramps Web install behind a Cloudflare tunnel and think it’s a great program, but I’m trying to give users the information in a format they are most comfortable with. And for some, a USB stick is easy-peasy and for me, And I am more comfortable sharing a USB drive with a wider circle than my NAS.)

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 16, 2026, 6:13pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/28 "2026-09-16T18:13:29Z")

</div>

Interesting

I have looked at a sample maps file ie Maps/0/0/xxxx

I see 2 areas that have URL’s

Line 2  
xmlns=“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)”

Line 42 to 45

Could you indicate which URL’s you change  
Thanks  
phil

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [September 16, 2026, 6:16pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/29 "2026-09-16T18:16:29Z")

</div>

With narrative web, the maps are depending on openlayers.  
The last version is 10.10.0  
Did you try to use an older version.  
You can do that modifying gramps.ini:

…  
[external\_modules]  
openlayers\_version=‘v6.15.1’  
…

Recreate the report and try.

---

<div class="post-metadata">

**Author:** ![jackdlail](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jackdlail](https://gramps.discourse.group/u/jackdlail)\
**Post date:** [September 16, 2026, 7:21pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/30 "2026-09-16T19:21:22Z")

</div>

I haven’t tried to modify the narrative web output, but I did for greatgramps.

Swap OpenStreetMap tile URL with ESRI World Topo tiles

esri\_url = “[https://server.arcgisonline.com/ArcGIS/rest/services/World\_Topo\_Map/MapServer/tile/{z}/{y}/{x}](https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D)”

text = text.replace(“[https://tile.openstreetmap.org/{z}/{x}/{y}.png](https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png)”, esri\_url)

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 16, 2026, 7:46pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/31 "2026-09-16T19:46:24Z")

</div>

Looked at greatgramps interesting but not enough to make me want to  
change thanks for replying.  
phil

---

<div class="post-metadata">

**Author:** ![pgerlier](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@pgerlier](https://gramps.discourse.group/u/pgerlier)\
**Post date:** [September 17, 2026, 9:36am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/32 "2026-09-17T09:36:42Z")

</div>

The problem is more complicated than it appears at first sight.

NarrativeWeb creates static HTML pages which can be displayed two ways at user’s choice.

- for those tech-savvy, served by a local **web server**  
This is the most homogeneous method because everything is HTTP from start to end. The browser adds the necessary headers to the request and these headers, like `Referer`, are also used for secondary GET requests.
- for common users, shown with `File` → `Open File`  
HTTP protocol is completely bypassed. No header is generated because there is no request, simply file retrieval which is fully specified by the filename. Then secondary GET requests for OSM tiles have no “context headers” to attach.

The problem is not in NarrativeWeb, nor in Gramps. It is in the browsers. It is likely a short sight in design: requests and file retrieval are separate. There is no HTTP request in the second case. But designers did not take into account that HTML files could need auxiliary data from the net. and thus need “identification” or “context” headers.

IMHO, there is nothing that can be done in Gramps: HTTP headers are not members of HTML files; they are added by the browser at request time.

I tried to outsmart Firefox adding a `<meta http-equiv=Referer content="http://localhost">`. But it did not change. This seems to be logical: since opening files is not HTTP protocol, this `meta` element is meaningless and ignored. It seems also not to override the standard `Referer` header when used through HTTP.

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [September 17, 2026, 10:18am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/33 "2026-09-17T10:18:06Z")

</div>

With about:config, what is the value of `network.http.sendRefererHeader`

The default value which is the default for me is 2.  
I have no problem.

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 17, 2026, 11:04am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/34 "2026-09-17T11:04:07Z")

</div>

My Browser is Firefox with default value of 2, it does not work. Chromium browser used to work until I foolishly asked on Openstreet why this should be. And one of the volunteers came back to explain it should not work on Chromium either. he thanked for me pointing this out and corrected the blocking mechanism on Openstreet so that Chromium now no longer works.

### Which Browser are you using

They did suggest work rounds which are beyond my understanding and I have posted these on the list

phil

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 17, 2026, 1:34pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/35 "2026-09-17T13:34:06Z")

</div>

Could I add to this my thoughts as to why we are where we are.

Murphy’s Laws  
Number 3  
“Best intention’s inevitably give rise to unintended consequences.”

The scenario runs like this

Somebody at Web Content Providers (ie Openstreet) notices that they are getting a lot of service outages due to bot attacks, decides to talk to his/her mate at Mozilla (other browser providers are available) can you help here he says so nice person at Mozilla says yes leave it with me.

Lo sometime later we get the “referer” (obviously developer could not spell) defence and it gets implemented now the man on the street notices his nice static website no longer works and takes it up with the content provider who checks with the browser provider who says yes we know about that but there are not many complaints just reply it is being worked on (code for it is going into the long grass). Thus GRAMPS Narrative Web Report (static site) being at the bottom of the food chain has a problem.

The Report was a nice simple way of presenting a lot of information to people who can plug a USB Stick into a computer (but little else, obviously a minority sport) without having to setup a web server.

This will be my last comment on this topic as I have spent too much time chasing my tail round the net for a simple fix.

phil

---

<div class="post-metadata">

**Author:** ![pgerlier](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@pgerlier](https://gramps.discourse.group/u/pgerlier)\
**Post date:** [September 17, 2026, 5:47pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/36 "2026-09-17T17:47:02Z")

</div>

> [@SNoiraud](#):
>
> The default value which is the default for me is 2.

Same for me.  
  
No problem when page served through local NginX; OSM blocked if I open file directly (and it seems logical because there is no referrer when opening a file).

---

<div class="post-metadata">

**Author:** ![bdeket](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/bdeket/32/9575_2.png) [@bdeket](https://gramps.discourse.group/u/bdeket)\
**Post date:** [September 19, 2026, 2:14pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/37 "2026-09-19T14:14:07Z")

</div>

The latest 2 or 3 versions of firefox offer to spin up a local server for you.

If you open the site from file, then go to developper tools ( hit F12 ) firefox offers to spin up a server and access the site via localhost (somewhere in the top right corner). I’ve not tested this with OSM specifically, but it did work in other situations where a site from file did not work.

The downside is that you need to do it each time you load the file.

---

<div class="post-metadata">

**Author:** ![pgerlier](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@pgerlier](https://gramps.discourse.group/u/pgerlier)\
**Post date:** [September 20, 2026, 8:59am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/38 "2026-09-20T08:59:49Z")

</div>

It works!

Starting with Firefox 153.0, you can configure a “fake” localhost server according to

> **[Local Mode — Firefox Source Docs documentation](https://firefox-source-docs.mozilla.org/devtools-user/local_mode/index.html)**

I added a setting for `http://osm.localhost` pointing to my directory. Then, I entered `osm.localhost` in the URL bar. I navigated to a place page and the OSM tile is there.

Don’t forget to activate _Web Development Tools_ before asking for the “fake” web server otherwise FF will try HTTPS and reject the request.

---

<div class="post-metadata">

**Author:** ![comeng](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@comeng](https://gramps.discourse.group/u/comeng)\
**Post date:** [September 28, 2026, 7:34pm UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/39 "2026-09-28T19:34:55Z")

</div>

Whilst this works it is definitely not user friendly ie more than basic  
computer skills are required, also the development window takes up a  
significant chunk of the user screen.  
So not practical for passing a usb stick to a family member even worse I  
suspect if trying to give a presentation.  
Will have to look at the Narrative Web code again to see if a mod is  
possible but not in the immediate future and probably outwith my  
technical ability.  
phil  
Thanks for the suggestions

---

<div class="post-metadata">

**Author:** ![pgerlier](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@pgerlier](https://gramps.discourse.group/u/pgerlier)\
**Post date:** [September 30, 2026, 7:53am UTC](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958/40 "2026-09-30T07:53:34Z")

</div>

> [@comeng](#):
>
> Will have to look at the Narrative Web code again to see if a mod is  
> possible

I don’t think so. What you could change is page “contents” while the behaviour is related to the protocol used to display the page.

When you `http://…` to a page, you’re entirely inside HTTP and a `Referer` header is sent. With `file:///…`, you are not in a remote protocol, you access files directly on your computer and headers are not meaningful (most of them if not all are not generated because there is no use for them).

What you would need is the possibility to generate HTTP-headers but there is no way to do so when static pages are stored. HTTP-headers are sent by the server before page transmission begins. This could be done if Gramps was turned into some kind of web server engine but we won’t then have a collection of static pages. And any way, this no longer works when the static pages are put on a USB stick without going through a web engine.

> [@comeng](#):
>
> the development window takes up a  
> significant chunk of the user screen

It can be closed once the configuration is done.

[Previous page](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958.md?page=1)

[Next page](https://gramps.discourse.group/t/narrative-web-openstreeetmap-referer/9958.md?page=3)
