<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[API webRequest onHeadersReceived listener issue]]></title><description><![CDATA[<p dir="auto">This is about a Browser Extension development.</p>
<p dir="auto">The technical issue being <strong>Opera</strong> not dispatching the top web-page <strong>Response header</strong> to a registered <strong>listener</strong>.</p>
<p dir="auto">And this happens when both <strong>Chrome</strong> and <strong>Edge</strong> are always sending the event missed by <strong>Opera</strong> as the very first for every single URL full reload.</p>
<p dir="auto">This first HTTP Response sent by a server is where a <strong>Content-Security-Policy</strong> may be specified. And I am migrating from manifest v2 to v3 an extension that needs to access this header.</p>
<pre><code>chrome
            .webRequest
            .onHeadersReceived
            .addListener(   ohr_listener
                          , {urls: ["&lt;all_urls&gt;"]}
                          , extraInfoSpec
                        );
</code></pre>
<p dir="auto">Instead of describing the details and all I've tried to find a explanation, I published a dedicated test-purpose-extension on GitHub about the issue:<br />
● <a href="https://github.com/ivanwfr/OHRExtension" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ivanwfr/OHRExtension</a><br />
I explain everything in the Readme and the extension can be installed from a simple clickable zip.<br />
And it's self-explanatory to use for someone who knows something about DevTools and Load unpacked.</p>
<p dir="auto">I have spent weeks working on the subject.</p>
<p dir="auto">I am not looking for recommendations or guidance about how I have to make sure I didn't miss something obvious, I got many of those from GPT-3.5 and Bard.</p>
<p dir="auto">As I am working with Manifest V3 and its service-worker and Promises async APIs, I tried everything on my side before claiming I've found a bug in Opera!</p>
<p dir="auto"><strong>Here is the manifest I am working with:</strong></p>
<pre><code>{
    "manifest_version"   :               3 ,
    "name"               : "OHR checker v3",
    "short_name"         : "ORH",
    "description"        : "Manifest v3 ● onHeadersReceived checker",
    "author"             : "Ivan Wellesz",

    "version"            : "1.23.08.24",
    "permissions"        : [
        "activeTab",


        "declarativeNetRequest",
        "declarativeNetRequestFeedback",
        "declarativeNetRequestWithHostAccess",


        "scripting",

        "tabs",

        "webRequest"


    ],
    "host_permissions"   : [
        "&lt;all_urls&gt;"
    ],
    "declarative_net_request": {
        "rule_resources"      : [
            {
                "id"               : "rules1_SET",
                "path"             : "rules1_SET.json",
                "enabled"          :  true
            },
            {
                "id"               : "rules2_REMOVE",
                "path"             : "rules2_REMOVE.json",
                "enabled"          :  false
            }

        ]
    },
    "icons"              : {
        "32": "icon.png"
    },
    "background"         : {
        "service_worker"  :   "background.js"

    },
    "action"             : {
        "default_title"   : "OHR checker",
        "default_popup"   : "popup.html",
        "default_icon"    : "icon.png"
    }
}
</code></pre>
<p dir="auto">Thanks for reading,<br />
Here I am <a href="mailto:ivanw@orange.fr" target="_blank" rel="noopener noreferrer nofollow ugc">ivanw@orange.fr</a></p>
]]></description><link>https://forums.opera.com/topic/65778/api-webrequest-onheadersreceived-listener-issue</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 18:55:42 GMT</lastBuildDate><atom:link href="https://forums.opera.com/topic/65778.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Aug 2023 19:31:36 GMT</pubDate><ttl>60</ttl></channel></rss>