What is causing the browser action popup for my Chrome extension to not appear?

Here is the content of my manifest.json file:

{
    "browser_action"        :
    {
        "default_icon"  : "Assets/Chromium logosu.png",
        "default_popup" : "main.html"
    },
    "description"   : "This extension monitors and installs updates for Chromium.",
    "manifest_version"  : 2,
    "name"          : "Chromium Updater",
    "version"       : "1.0"
}

And here is the code from my main.html file:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder 16 - https://www.wysiwygwebbuilder.com">
<link href="Chromium_Updater_Extension_Project.css" rel="stylesheet">
<link href="main.css" rel="stylesheet">
</head>
<body>
<div id="wb_Image1" style="position:absolute;left:0px;top:0px;width:320px;height:50px;z-index:0;">
<img src="Assets/Title.png" id="Image1" alt=""></div>
<div id="wb_Image7" style="position:absolute;left:0px;top:160px;width:320px;height:35px;z-index:1;">
<img src="Assets/Copyright Text.png" id="Image7" alt=""></div>
<div id="wb_Image2" style="position:absolute;left:0px;top:50px;width:320px;height:37px;z-index:2;">
<img src="Assets/Check Updates (Inactive).png" id="Image2" alt=""></div>
<div id="wb_Image3" style="position:absolute;left:0px;top:87px;width:320px;height:36px;z-index:3;">
<img src="Assets/Settings (Inactive).png" id="Image3" alt=""></div>
<div id="wb_Image4" style="position:absolute;left:0px;top:123px;width:320px;height:37px;z-index:4;">
<img src="Assets/About (Inactive).png" id="Image4" alt=""></div>
</body>
</html>

Upon clicking the extension's button, I encounter the following popup menu:

Link to my extension's popup menu

However, the UI of my popup page should actually appear as shown in this image:

Link to the UI of my popup file

What steps can I take to address and resolve this issue?

Answer №1

When displaying a popup in HTML, its height and width are determined by the content loaded within it.

In this specific case, all div elements within the body are set to position:absolute, causing the body tag to have zero height and width. This results in the Popup UI appearing as a small box when opened as a browser action popup.

You can test this behavior by assigning a fixed height or width to the body tag in your CSS.

Why does it look fine when main.html is loaded directly into the browser? It may appear fine, but in reality, the body still has zero height. The difference lies in the viewport not being dependent on the body's content, allowing it to display the content outside of the body as shown in the sample screenshot below.

https://i.sstatic.net/2QIB6.png

How can this issue be resolved? Adjust your CSS so that the body encompasses the actual content you want to display, providing it with an appropriate height. Consider avoiding positioning every element as absolute; there may be a better approach to achieve the desired UI. Alternatively, you could manually set the body's height and width to match the size of the desired popup HTML layout.

Answer №2

@Samantha Smith

Hey there, I managed to resolve my problem by taking the following steps:

1- Initially, I eliminated all instances of "position:absolute;". However, this caused a new issue to arise - the image order was disrupted.

2- To rectify this second issue, I resorted to a unique technique. I combined the last three images into a single image.

In any case, your input was greatly appreciated.😊

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The JSON.Parse function in Google Apps Script is leading to a 'server connection error' message during debugging

I'm not a professional developer, but I do code occasionally. Currently, I am working on some Apps Script code to interact with an API and store the data in SQL. Most of it is working fine, but I have encountered an issue while debugging in the Apps S ...

Can Firebase lists be reversed?

I have searched extensively on SO for an answer to this question, but I haven't found a solution yet. Therefore, please do not mark this as a duplicate. Currently, I am working with AngularFire in Angular 2 and Typescript. I am using FirebaseListObse ...

Continuous execution of JQuery function despite modification of attribute

I am having an issue with my menu on the page. When I click on each menu item, it triggers one of the functions below: $('.sideNav1').click(function(){ $('.sideNav1').attr('class','selected1'); $('.sele ...

Frontend utilizing the Next-auth Github Provider for Profile Consumption

After following the official documentation for implementing SSO with the Next-auth Github provider in my App, I encountered an issue where the Client API documentation suggested using useSession() to retrieve session information, but it was not returning t ...

"Complete with Style: Expand Your Horizons with Material-UI

The Autocomplete feature in Material UI is not expanding to the full width of the TextField element. Any suggestions on how to fix this issue? https://i.sstatic.net/3ccdp.png https://i.sstatic.net/KdkrO.png ...

Data does not have a permanent home in MongoDB

Recently, I delved into the world of nodejs, mongoose, and express with the intention of creating a basic twitter clone. However, I encountered an issue where nothing happens when I attempt to submit a new tweet. Below is the code snippet I'm working ...

The factory is not receiving any data from the controller

In a hypothetical scenario, picture a facility where inmates are housed in individual cells. My goal is to access a particular cell by invoking the API '/getparameters' which will provide me with the cell number. Subsequently, I intend to utilize ...

Issue with slide animation in carousel on Bootstrap version 4.5.2 not functioning as intended

Recently, I've been diving into learning Bootstrap (v4.5.2) and decided to implement a basic carousel on my website that slides automatically. Following the documentation on Bootstrap's website, I copied the example code for a simple carousel wit ...

Tips for including vertical lines within text boxes to distinguish elements

I've been working on a simple form using CSS and HTML, but I'm struggling to add vertical lines to separate my text from the radio buttons. Right now, I'm just using '|' to divide them, but it's not the most visually appealing ...

What You Need to Know About Hovering and Highlighting Buttons Using CSS

As a beginner in CSS, I decided to practice padding and margin mechanics by creating two buttons. Now, I'm trying to make the buttons larger without one button pushing the other out of place. I managed to achieve this for the save button, but I'm ...

When hovering over the main menu, the submenu appears hidden behind it

I am struggling with setting up a dropdown submenu on my website that uses a responsive Joomla template. The submenu always appears behind the main menu and slider, despite trying z-index and relative positioning. Can anyone help me figure out what I' ...

What is the best method to convert a variable array into a string array using jQuery in the context

I've been working with this jQuery code snippet: function extractParameter() { var values = []; $("input[name='SelectedServiceTypes']:checked").each(function (i) { values.push($(this).val()); }); if (values.length == ...

Guide on determining if the value in a JSON object is a string or an array in Node.js

Running a Node.js application, I encountered the following JSON array structure. First JSON object: var json1= { bookmarkname: 'My Health Circles', bookmarkurl: 'http://localhost:3000/', bookmark_system_category: [ '22&apos ...

Adjusting Chart.js line graph alignment to the left

I'm curious about why my chart is not aligned to the left and how I can fix this issue. Here is the code snippet I am working with: var data = { labels: ["ID"] , datasets: [ { label: "Sensor 1" , data: [{ ...

Creating an array of objects in Node.js can be achieved by simply declaring an array

Here's the structure of my class: var Coin = { _id: null, createGame: function(id) { this._id = id; }, start: function() { } }; My issue is that I am unable to create an array of objects, as I can only create one. Can someo ...

What is the best approach to filter data in D3 by multiple variables within JSON data?

Seeking guidance with D3.js for my new project. I have JSON data containing course titles, attendance records, and last attendance dates. How can I filter or manipulate this data to calculate the mean attendance for each individual course title within the ...

Tips for increasing the complexity of your bottom-line animation

Hello everyone, I am currently learning the basics of CSS and have a question about a specific animation effect. Please bear with me if this type of inquiry is not suitable for StackOverflow. In my index.html file, I have the following code: <n ...

Safari 5 experiences delays with JQuery and CSS3 animations

Encountering issues with jQuery animations specifically in Safari 5 on my Windows system. Struggling with a simple image fade slider that still has some flickering. The slider involves click events moving two pages at once, one active page right and the o ...

How can I align my checkboxes horizontally with a set number using bootstrap?

Is there a way to align my checkboxes next to each other in columns of 5, rather than being stacked vertically? The current layout looks like this: Checkboxes vertical I would like the checkboxes to appear like this: [x] label [x] label [x] label [x] l ...

Set the page to be rigid instead of flexible

I'm struggling to lock this webpage in place, so it doesn't resize when the browser window changes. The text keeps collapsing whenever I adjust the size of the browser, and I can't figure out what's going wrong. Can someone please help ...