google-chrome-extension

Chrome window types. What do they stand for?

我的梦境 提交于 2019-12-13 11:46:32
问题 chrome.windows API tells about 5 window types: "normal", "popup", "panel", "app", "shell". Normal windows are standard windows with tabs; Popup windows are 1) standalone windows with apps (this feature is currently available on Windows and Linux), 2) chrome devtools if its window is open separately; But what are the other 3 window types? Official API provides very little information about this 回答1: App used to be the application mode window (ran with --app=http://... ) and is now replaced by

Chrome extension, chrome extension communication

梦想与她 提交于 2019-12-13 11:12:09
问题 Below is my manifest.json: { "name": "My Extension Name", "version": "1.9.1", "manifest_version": 2, "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "homepage_url": "https://www.mysite.com", "description": "My Extension Description", "permissions": ["http://www.example.com/*"], "content_scripts" : [{ "matches" : [ "http://www.example.com/*"], "js" : ["contentscript.js"], "run_at" : "document_end" }], "web_accessible_resources": ["script.js"] } My contentscript.js is

In a webpage, how can I detect that a particular extension is loaded in a browser? [duplicate]

无人久伴 提交于 2019-12-13 11:10:11
问题 This question already has answers here : Can websites tell what addons are installed in a Firefox web browser? (3 answers) Check if user has a third party Chrome extension installed (1 answer) Closed 3 years ago . I was asked to display a pop-up to the user if he has at least 1 out of 5 extensions. The extensions are: adblock plus , adBlock , Disconnect and etc... I am not familiar with all the extensions and their affect on the DOM (except for adblock plus ) so I am looking for a function

Trigger click not working

╄→尐↘猪︶ㄣ 提交于 2019-12-13 10:27:21
问题 Edit: Thank you so much for all the effort, got all my code running now! I want to trigger a click on https://shop.adidas.ae/en/stan-smith-shoes/S82255.html (to make a shoe bot). Why does this code not work to trigger the size type button? setTimeout(function () { $('select.product-type.js-size-type').trigger('click'); }, 1000); This is the select button: <select class="product-type js-size-type"> This is what chrome console says caught TypeError: Cannot read property 'click' of null at

Do I have to call return true each time I use onMessage.addListener responseCallback?

不打扰是莪最后的温柔 提交于 2019-12-13 10:14:37
问题 I have the a onMessage.addListener function like this: chrome.runtime.onMessage.addListener(function (r, s, sendResponse) { if (r.action == "read") { readManga(request, function () { sendResponse({}); }, true); } if (r.action == "write") { readManga(request, function () { sendResponse({}); }, true); } if (request.action == "update") { $.each(request.list, function (index, val) { resetManga(val, function () {}, false); }); saveList(); refreshUpdate(); sendResponse({}); } if (request.action ==

Creating Google calendar events from Gmail

依然范特西╮ 提交于 2019-12-13 09:53:46
问题 I like how my flight information directly pops up in my Google calendar (even if it's a bit scary) and I would like the same thing to happen when, e.g., I book train tickets. My first though was to make a Chrome extension which would parse my Gmail inbox for specifik strings and then create a calendar event if it found the right info. But, when reading about the calendar API I realized that it would be more logical to use the Gmail API and get the data from the mail directly then to parse a

Modify page element as soon as it's loaded

喜欢而已 提交于 2019-12-13 09:49:43
问题 I'm currently writing a very simply Google Chrome Extension that utilizes Content Scripts, to simply add additional text onto a webpage by grabbing the element and appending to its innerHTML when the page is finished loading. The issue is that the webpage I'm modifying is rich in media and takes several seconds to load, thus causing the additional text to not display until a few seconds after the rest of the text has loaded. The element I'm grabbing is a span . Is there any way of listening

Adding jquery in developing a chrome extension [duplicate]

孤者浪人 提交于 2019-12-13 09:28:29
问题 This question already has answers here : Loading jQuery into chrome-extension (2 answers) Closed 5 years ago . I looked at several posts about adding jquery in developing a chrome extension - but most are old and use manifest options that were deprecated (such as "background_page"). I have already added the "content_scripts" member. I still get " Uncaught ReferenceError: $ is not defined ". Taking the simplest possible scenario - building upon Chrome's extension sample to add jquery to it -

Month and Year not displaying

≡放荡痞女 提交于 2019-12-13 09:27:02
问题 I'm trying to display the current month and year, but nothing is being displayed. HTML: <div id="date"></div> CSS: #date { display: block; color: black; font-size: 50px; top: 50px; left: 50px; } JavaScript: (function() { var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; Date.prototype.getMonthName = function() { return months[ this

Call functions on pages from background

穿精又带淫゛_ 提交于 2019-12-13 08:52:01
问题 Is it possible to call function on a page? For example I have a page called help.html and that page has a function called help(id). Can I call this function and pass the id to it? Thanks in advance 回答1: You can if the page is opened and loaded, and you have a reference to its window object. One way to make sure both things are true is to have code on your help window call a function on your background page when it is ready, passing a reference to itself. So on your help window you can have