Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //background.js
- chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
- var tab = tabs[0];
- if (tab && tab.status === "complete") {
- var html = tab.contentDocument.documentElement.outerHTML;
- console.log(html);
- var tabURL = tabs[0].url;
- console.log(tabURL);
- }
- });
- //manifest.json
- {
- "manifest_version": 3,
- "name": "HTML Reader",
- "version": "1.0",
- "description": "Test",
- "version": "1.0",
- "permissions": ["activeTab", "tabs"],
- "action": {
- "default_popup": "popup.html",
- "default_icon": "icon.png"
- },
- "icons": {
- "48": "icon.png"
- },
- "content_scripts": [
- {
- "matches": ["https://google.com/*"],
- "js": ["background.js"]
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement