I want to develop a Chrome Extension that reads CSS and Images of a website. What I am trying to achieve will have the functionality of something like CSS Peeper https://csspeeper.com/. Is it possible with content script or background script? I have tried looking for a solution but could not find what I am looking for.
manifest.json
{
"manifest_version": 2,
"name": "Get all css rules in stylesheets",
"background": {
"scripts": ["background.js"],
"persistent": true
},
"permissions": ["activeTab", "tabs", "webRequest", "storage", "<all_urls>"],
"version": "1.0",
"page_action": {
"default_icon": {
"16": "images/get_started16.png",
"32": "images/get_started32.png",
"48": "images/get_started48.png",
"128": "images/get_started128.png"
}
},
"icons": {
"16": "images/get_started16.png",
"32": "images/get_started32.png",
"48": "images/get_started48.png",
"128": "images/get_started128.png"
}
}
I also tried to dig through CSS Peeper code but I only found background.js file:
/* CSS Peeper background.js file */
chrome.browserAction.onClicked.addListener(function () {
chrome.tabs.executeScript({
file: 'scripts/index.js'
});
chrome.tabs.insertCSS({
file: 'styles/page.css'
});
});