Issue with chrome manifest 2 json background not functioning properly

I am currently developing a Chrome app that displays a Twitter search widget. I have encountered an issue where my app works perfectly with manifest version 1, utilizing "background_page" to display the main HTML page effectively. However, when switching to manifest version 2 and using the new "background" property, I am facing difficulties.

"description": "Live",
  "version": "1",
  "manifest_version": 1,
  "app": {
    "launch": {
      "local_path": "index.html"
    }
  },
  "background_page":"index.html",

  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  }

The code above functions properly, but the code below presents challenges:

  "description": "Live",
  "version": "1",
  "manifest_version": 2,
  "app": {
    "launch": {
      "local_path": "index.html"
    }
  },
  "background": {
    "pages": "index.html"
  },
  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  }

When using manifest version 2, the page loads without loading the JavaScript. In contrast, manifest version 1 does load the script successfully.

Could you please guide me on how to load the JavaScript using manifest 2?

Your assistance would be 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

Using JSON strings and the .format() method in Python3

My goal is to create a JSON string using the .format() method. However, when I attempted to do so with the code below: TODO_JSON = '{"id": {0},"title": {1},"completed:" {2}}' print(TODO_JSON.format(42, 'Some Task', False)) I encounter ...

What is the best method for iterating through the AJAX response?

I am currently exploring AJAX coding techniques and have recently started using jQuery. My goal is to retrieve subcategories from a MongoDB database and dynamically populate them in separate option tags within a select tag once the parent select tag is cli ...

Is there a way to work around coursera's keyboard input verification using JavaScript?

Is it possible to bypass Coursera's keyboard input verification using JavaScript? For example: What methods or techniques could be used to accomplish this? ...

Resolving the Angular5 (Angular Universal) problem with page source visibility

Currently tackling a server-side rendering project, inspired by the Angular Universal guide. Everything seems to be on track, but I'm facing an issue where even when navigating to different routes, the source code for the initial page is displayed whe ...

React - automatically play audio when fully loaded

I need the audio to play only after it has been fully loaded, ensuring a smooth playback experience for users with slower network connections. Here is my component structure: class MusicLoop extends Component { state = { isLoaded: false } ...

Substitute "Basic Authentication" with "Form Authentication"

Is there a way in W20 to switch from using "Basic Authentication" to "Form Authentication"? The current documentation mentions only the use of "basicAuth" and does not provide information on implementing form authentication. Our app is built with Angular ...

Guide to dynamically add data to two columns

I have a challenge with organizing multiple inputs into rows with two columns each, ensuring that each input is appended to the appropriate side (50% for each column unless there's an odd number of inputs). Currently, the inputs are being added to se ...

How to retrieve multiple person or group values in SharePoint using JavaScript

Names from my SharePoint list are stored with the field names 'People' and 'Responsible', added using a peoplepicker. These fields are of type 'person or group' in SharePoint. In my Service file, I have the following code: ...

Do not engage with the website while animations are running

I'm working on a JavaScript project where I want to create textareas that grow and center in the window when clicked, and shrink back down when not focused. However, I ran into some issues with the .animate() function that are causing bugs. During QA ...

Why is JSON_encode in PHP returning NULL when trying to echo?

Currently, I am diving into the world of JSON and finding it quite challenging. While I had success encoding a normal variable and echoing the JSON string, I'm facing difficulties when trying to encode an object: class Tariff { var $preset_name; ...

Adjust the mouse scrollbar and correct the vertical scrollbar in Codemirror 3.23 when switching the direction to rtl

Is there a way to dynamically change the text direction based on the language being used? I encountered an issue when switching from LTR to RTL where two vertical scrollbars appear in the textarea of codemirror. Removing the overflow-y: scroll property cau ...

What is the JSON format for a ticket booking system using Firebase as the database?

In the process of developing a ticket reservation system that allows users to choose events, view sections, and select available seats, I have decided to utilize Firebase as my backend. However, I have limited experience working with databases and JSON. Ho ...

Parsing large numbers in JSON data using the json_decode function

Facing an issue while decoding a json string The PHP version being used is 5.4.4-7 and the operating system is Debian amd64. Here is the JSON string: {"status":"success","account":{"buy_title":"KGP ID","birthday":0,"sex":0,"phone_number":"","avatar":"ht ...

What is the solution to the problem of "Failed to execute 'json' on 'Response': body stream already read"?

enter image description here Encountered Issue: Error in processing JSON data in the Response: body stream already read The error mentioned above is a result of issues within your application's code, not due to Cypress. It occurred due to an unhandle ...

What is the best way to search the NPM REST API in order to find the most accurate results?

I'm trying to find an effective way to query the npm REST API in order to get relevant search results. I aim to seamlessly integrate this search feature into my application. For instance, when I search for "bootstrap" on npm, I receive various result ...

Distinguishing factors between $(document).ready and $().ready in jQuery

Currently, I am delving into some unfamiliar code in my work. I am making an effort to grasp it thoroughly. While I have a few months of experience using jQuery and am fairly comfortable with it, I'm still not an expert. Unfortunately, my attempts to ...

Click on the button to add a new question and watch as another row magically appears

Working with ReactJS My goal is to display 10 rows by default, followed by a button labeled "Add a new question" which would create the 11th row. View current row image here Currently, only one row is being shown [referencing the image below]. I aim to ...

Sending postMessage during the beforeunload event does not work as expected

When postMessage() is triggered within the beforeunload window event in an Ionic 2 browser, I've noticed that the message doesn't make it to the parent. However, if the same message is sent during the unload or load event, it is received successf ...

The Jqueryui image link is not displaying the image despite no error being reported

Can anyone help me figure out what I'm missing? I'm currently working with ASP.NET MVC 5 and have downloaded the JqueryUI combined via Nuget package. Despite no error references for css/js files, the close button is still not showing in the ima ...

Using JS/PHP to send a POST request to a PHP script for querying a database

Trying to gather user input and then pass it to another PHP script for utilizing in a MariaDB query. Index.php: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="robots" content=&q ...