Issue with Chrome Extension interface not visible

Attempting to develop my first chrome extension by following this helpful guide - https://developer.chrome.com/docs/extensions/mv3/getstarted/

Encountering an issue where upon clicking the extension icon in my toolbar, instead of seeing the button as intended, I am presented with the HTML code.

This is a snapshot of my extension directory: view directory image

Showcased below is the content of popup.html:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href=“button.css">
  </head>
  <body>
    <button id="changeColor"></button>
    <script src="popup.js"></script>
  </body>
</html>

Furthermore, presenting the stylesheet used for the button referenced above:

button {
  height: 30px;
  width: 30px;
  outline: none;
  margin: 10px;
  border: none;
  border-radius: 2px;
}

button.current {
  box-shadow: 0 0 0 2px white,
              0 0 0 4px black;
}

In need of assistance to rectify the display issue and have the correct button shown instead of the HTML script.

Answer №1

You may be experiencing a Content Security Policy error.
For additional information and a potential solution, you can visit this webpage.

If the above suggestion does not resolve your issue, please share the other files of your extension so I can investigate further (:

I hope this advice proves useful to you. Have a fantastic day!

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

Flex Item will only respect the margin or padding when both are set simultaneously

I've been playing around with CSS and running into a problem where a flexbox item isn't respecting margin and padding correctly, causing the right side to have no margin. Here's a simplified example I came up with: <body> <div c ...

Transferring the AJAX response into a JavaScript variable

New to AJAX and JS here. I am implementing an AJAX code that fetches data from a php service. I am trying to figure out how to store the returned data in a JavaScript variable, which I can then display on the UI. Below is my AJAX code snippet: <script ...

Pop-up functionality in Chrome Extension suddenly malfunctions and shuts down upon switching to a different tab

Simply using the extension to extract data from the current page. Upon clicking the extension icon, a popup appears and retrieves the data from the page. However, if I click on the popup and switch to another tab or window, the popup stops working. Look ...

Tips for capturing changes in a "count" variable and executing actions based on its value

I have a counter on my webpage and I'm trying to change the style of an element based on the count variable. I tried using the .change action but I haven't been able to get it working. It might not be the right solution. Can anyone provide some ...

use jquery to increase margin on card upon collapse displaying

I'm currently using an accordion from a bootstrap 4 website. <div class="accordion" id="accordionExample"> <div class="card m-0"> <div class="card-header bg-white" id="headingOne"> <h5 class="mb-0"> <but ...

What is the most efficient way to implement hiding/showing elements, adding/removing classes, and optimizing code in jQuery?

Looking for a more elegant solution to toggle classes on a div when clicking a button? Current code logic: jQuery(document).ready(function($) { // Removing/adding classes to show/hide div elements on button click // More efficient w ...

Keep the HTML video link out of sight in the Control Center on iOS devices

Looking for a way to conceal the video URL from appearing in the iOS Control Center, can anyone provide a JavaScript or HTML code solution? https://i.sstatic.net/NI79O.png ...

What is the best way to extract data from various HTML files using RVEST and save it into an Excel spreadsheet?

I am struggling to find a solution for my current problem as I am not fluent in R. My challenge is working with 800 html files and accessing all the h2 elements within each file. Currently, I have managed to do this with individual website URLs using the ...

Is it not advisable to let the column height in Bootstrap automatically adjust to the content, unless specified otherwise?

Currently, I am immersed in an online training course focused on bootstrap coding. I am diligently following the steps outlined in the tutorial, but encountering an unexpected issue. The row I have created is displaying with a much larger height than inten ...

When clicked, elevate the element to the top of the window with an offset

Is there a way to click on this button, which is located within an accordion section header, and have it automatically move to the top of the page based on the window size? It seems like it should be a simple task, but sometimes after a long day things ca ...

Taking out the z-index from the transition code

Is there a way to restructure the code without needing to use z-index for the transition? Without z-index: https://jsfiddle.net/Legcb42d/ .container1 { position: relative; width: 100%; height: 100%; } .container1.slide { height: auto; min-heigh ...

Keep updating information dynamically using Ajax

I've set up a page featuring Bootstrap cards that fetch information from a MySQL database. What I'm Looking For I want these cards to refresh every 3 seconds without the need for page reload. I believe Ajax is the solution for this task as it a ...

How to select a button within a table using Selenium and C#?

I'm struggling with a section of HTML code. My goal is to use the selenium chrome driver in C# to navigate a website and create a ticket. However, I've encountered an issue where I need to select a tab to check some checkboxes, but all the tabs h ...

Arranging two div elements side by side with spacing between them using CSS

Can anyone help me with aligning two divs side by side using CSS? I attempted a few methods on my own but seem to be stuck. Any suggestions would be greatly appreciated! CSS: .posts{ display: flex; flex-direction: row; } .posts .col-md-6{ pa ...

Unable to replicate the functionality of the tab key using jQuery for the enter key

How can I focus on the first input ('Qtd on the table') after pressing enter on the 'Buscar' input? I've tried various solutions like $(this).nextAll('input').first().focus(); $(this).next('input:text').focus ...

Is it possible to insert a button into a specific column of an ngx-datatable within an Angular 8 application?

I am having trouble with this particular HTML code. <ngx-datatable-column name="Option" prop="option" [draggable]="false" [resizeable]="false [width]="250"> <span> <button class="optionButton" type="button" data-to ...

Is the <style> tag effective when placed within other elements?

When I look at it, I notice something along these lines: <div> <style type="text/css"> ... </style> </div> It seems weird, but it's functional. Does this go against any standards? ...

Adjust the appearance of an element based on user selection from a dropdown menu under certain circumstances

I am working on creating a dropdown menu using a JavaScript array. My goal is to display a specific span element when certain options are selected. For instance, I want the span to be shown only when options "a" and "c" are selected, but not when option " ...

Is there a way to prevent the ENTER key on the keyboard from interacting with

When visiting http://api.jqueryui.com/datepicker/, I came across the following information: Keyboard interaction While using the datepicker, various key commands are available: PAGE UP: Move to the previous month. PAGE DOWN: Move to the next month. CTRL ...

Concealing a hyperlink within a DIV by removing or hiding it

I am looking to temporarily hide or remove a specific link (team.aspx) within a drop-down menu, with the intention of adding it back in later. Here is my current code: <div id="nav_menu"> <ul id="nav"> <li class="current"><a href= ...