I have a popup.html file that opens using a keyboard shortcut setup in the manifest.json file. The popup window opens, but its blank with no styling applied. In the Console, I get the message:
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
Yet, my popup.html file does contain the proper DOCTYPE definition. Here is the contents of the popup.html file:
I’m not able to reproduce the described issue using either Manifest V2 or V3 in Firefox Nightly on macOS.
Your note that the popup is “blank with no styling applied” suggests that the popup your extension is loading may be different from the HTML file you’re editing. You should at least see a textarea with default styling.
Thank you for your quick response. It’s very kind of you. I also like you explanation for Promises. I find that you’re very knowledgeable, not to say an expert, and I really appreciate the time you take to answer.
My extension is based on manifest v2 and I use Firefox Developer Edition 130.0b9 (64-bit). I don’t know if it’s related, but I see another error pertaining to my content script:
SyntaxError: import declarations may only appear at top level of a module
Not quite sure if I can use import statements inaa content script or if I need to define a module in the manifest?
This is the very top of my content script:
/// Import constants
import { mycroftUrl } from './hosts.js';
import { base64ContextSearchIcon, base64MultiSearchIcon, base64BackIcon } from './favicons.js';
This is what I see when I press ‘CMD+ALT+0’ to launch the popup (in debug mode):
UPDATE 1: Apparently, you can’t have immport statements in a content script, so I copy-pasted the needed constants in my content script. Unfortunately, the popup still opens in Quirks Mode!
UPDATE 2: I found my mistake. You were right! I had forgotten to update the path to my popup.html file that I had moved inside the html/ folder. Thank you.
I think we all bang our heads against these kind of errors. Last week I spent half an hour trying to figure out why my changes weren’t showing up. Turns out I renamed the file and updated the references to it, but the file I was editing in my text editor was saving to the old file path.
Well, at least repeating this kind of mistake makes them easier to recognize when you do it again