Google plugin (set page background)


Main steps
1.manifest. Declaring web in JSON_ accessible_ resources


2. create contextmenus in the background and listen for click events

var menuItem = {
    "id" : "resource",
    "Title": "setting the background image",
    "contexts": ["all"]

3. call chrome extension. Geturl get image URL

var imgurl = chrome.extension.getURL("img/beauty.jpg");

4. call executescript

chrome.tabs.executeScript(null,{code:" = 'url(\""+imgurl+"\")';\'repeat';"});

Source code
Extraction code: ond1

Recommended Today

Server enables elegant Internet access

Internet access in schools requires identity authentication. This identity authentication mechanism is troublesome for people who often use the Internet. In order to solve this problem, several feasible methods without manual authentication are proposed here to solve the pain point of identity authentication. Personal use host For personal computers, the simplest is to use Google […]