Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "name": "Asaf's Extension",
- "version": "1.0",
- "manifest_version": 2,
- "description": "Asaf's ZIK Extension",
- "permissions": [
- "<all_urls>", "tabs"
- ],
- "background": {
- "scripts" : [ "event.js" ],
- "persistent": false
- },
- "browser_action": {
- "default_icon": "icon.png"
- },
- "content_scripts": [
- {
- "matches": [ "*://*.ebay.com/usr/*" ],
- "css": [ "ebayButton.css" ],
- "js": [ "ebayButton.js" ],
- "run_at": "document_end"
- },
- {
- "matches": [ "*://*.zikanalytics.com/Analyze/Index/*" ],
- "css": [ "ZIKeyword.css" ],
- "js": [ "ZIKeyword.js" ],
- "persistent": false
- }
- ]
- }
- chrome.browserAction.onClicked.addListener(sellersList);
- function sellersList(tab) {
- chrome.tabs.executeScript(tab.id, {file: 'sellersList.js'}, results => {
- results[0].forEach(openSeller);
- });
- }
- function openSeller(url) {
- chrome.tabs.create({url, pinned: true, active: false}, collectCountry);
- }
- function collectCountry(tab) {
- chrome.tabs.executeScript(tab.id, {file: 'collectCountryjs'}, results => {
- chrome.tabs.remove(tab.id);
- results[0].forEach(analyzeSeller);
- });
- }
- function analyzeSeller(url) {
- chrome.tabs.create({url, active: false});
- }
- let urls = [...document.links]
- .filter(a => a.href.startsWith('http://www.ebay.com/usr/'))
- .map(a => a.href);
- [...new Set(urls)];
- var a = document.getElementsByClassName("mem_loc")[0];
- a.textContent.trim().startsWith("United States" || "Bulgaria");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement