Chrome kernel plug-in development error: Unchecked runtime.lastError: causes and solutions.

This article mainly explains why the chrome kernel plug-in development reports an error: Unchecked runtime.lastError: Extensions using event pages or Service Workers must pass an id parameter to chrome.contextMenus.create The reasons and solutions.
Date: June 10, 2023
Author: Ren Congcong

Error phenomenon:

To view the error reporting path, click the following entry on the Google Chrome extension interface to pop up!
insert image description here
Error message:
insert image description here

Related reasons and solutions

Reason 1. The plug-in is a right-click menu function type, and the declared parameters are missing

Explanation: When you make the right-click menu, you did not declare the permissions in the json file, or did not fill in the complete parameters in the bg.js file.

Solution:

  "permissions": [
    

Guess you like

Origin blog.csdn.net/hj960511/article/details/131142309