google-chrome-extension

Size of Chrome notifications

丶灬走出姿态 提交于 2019-12-13 19:13:45
问题 I am building an extension which give user notifications using the createHTMLNotification call, but I am having some trouble figuring out the relevant size restrictions to avoid getting ugly black horizontal and vertical scrollbars (On Ubuntu 12.04 Linux at least). Does anybody have any pointers to documentation giving some hints about what maximum sizes I should be aiming for, hopefully cross-platform? 回答1: maximum size on Windows Version 20.0.1132.47 (stable 144678) is 300 by 160 pixels.

Chrome Extension : Access DOM after chrome.tabs.update

社会主义新天地 提交于 2019-12-13 19:02:46
问题 My aim is to search for a div by id if it exists in all languages my site supports. manifest.json { "manifest_version": 2, "name": "Hello World!", "description": "This extension is to check if link is not visible when it should not :)", "version": "1.0", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "content_scripts": [ { "js": [ "jquery-1.11.1.min.js"], "matches": [ "http://*/*", "https://*/*"] }], "permissions": [ "tabs", "http://*/*", "https://*/*" ] }

Can anyone explain that what is the use of “match_about_blank” in chrome extension's manifest file?

此生再无相见时 提交于 2019-12-13 18:24:10
问题 I am new to chrome extensions but failed to know about the use of "match_about_blank" property in manifest file. Can anyone explain in easy words ? 回答1: Let me start by quoting the documentation of "match_about_blank": Whether to insert the content script on about:blank and about:srcdoc . Content scripts will only be injected on pages when their inherit URL is matched by one of the declared patterns in the matches field. The inherit URL is the URL of the document that created the frame or

Google Chrome extension - to open new tab directed to url when a certain url is searched in current tab?

邮差的信 提交于 2019-12-13 18:13:04
问题 I am very new (started today) to writing chrome extensions but need to write a 'fairly simple' one for tomorrow... I am really struggling to get my head round it though! I need to write an extension that opens a new tab or window (whichever is easier!) directed at a predefined url is opened when a certain URL is searched in the current. An example of this would be if the user typed in www.facebook.com I am trying to get the extension to then open a new tab/window with www.google.com in. Any

chrome extension - manifest version 2

痞子三分冷 提交于 2019-12-13 17:55:49
问题 I have a chrome extension that has a reference to the jquery file. this is my popup html (only the head tag): <head> <title>My Extention</title> <script type="text/javascript" src="http://www.MySite.com/Resources/JS/JQuery/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="MyExtensionScript.js"></script> </head> so in "MyExtensionScript.js" i thought i could use jquery but apparently the $ function is not defined. This is my manifest.json file: { "name": "My Test Extension",

How do we get the parent tab URL of the current chrome tab?

让人想犯罪 __ 提交于 2019-12-13 17:51:54
问题 On my application home page, there is a link which opens a new tab when clicked. After some research, I found below code which gets triggered when a new chrome tab is launched. The "active_tab" object below gives information about the current tab. But how do we get the Parent tab URL (previous active tab) here ? Please help. I need to get my Home page url here from which this active_tab is launched. chrome.tabs.onActivated.addListener(function(activeInfo) { chrome.tabs.get(activeInfo.tabId,

get passwords from chrome

情到浓时终转凉″ 提交于 2019-12-13 16:43:10
问题 Is it possible to access save passwords in chrome extension? I was looking through API but did not find it.. I want to export all passwords into different storage and using extension seems like logical way to do it, but I cannot find HOW to do it. Thanks for any help. 回答1: Ok, to answer my own question, it does not seem possible to access that information via extension API, but on linux (linux does not encrypt login information, windows does) all you need is to access "~/.config/chromium

Chrome.tabs.executeScript - tabs are not defined

二次信任 提交于 2019-12-13 16:18:48
问题 I am trying to write a chrome extension that has a button called 'btn3'. When I click on that button in the chrome extension (popup.html), it will click a button on the webpage. The button on the webpage has the following id: "regular-secondary-button send-message" 2 questions: I get the error of "tabs are not defined" for chrome.tabs.executeScript in the following codes. How can I fix that? Did I write anything wrong in the content_scripts.js? Thanks! Script of the button in chrome extension

Chrome Extension: Check if background script is running

拈花ヽ惹草 提交于 2019-12-13 15:55:42
问题 I have a background script that uses the setInterval command to do a network request on a routine basis. I was wondering if the background script can detect if the os goes on sleep or standby so that I can adjust the timer displayed upon resuming the background script. I understand that the setInterval timer is suspended during sleep based on this Answer: What happens to setTimeout when the computer goes to sleep? Code sample is background.js set_start_time(); search_set_int = setInterval

manifest.json, content_scripts limit matching to url with port number

二次信任 提交于 2019-12-13 15:19:22
问题 I'm writing a Google chrome extension that should only run when the URL matches http://*:8000/* Part of my manifest.json file: "content_scripts": [{ "matches": ["http://*:8000/*"], "js" : ["client.js"], "run_at": "document_end" }] I get the following error when trying to pack the extension. Invalid value for 'content_scripts[0].matches[0]': Invalid host wildcard. If I change matches to <all_url> it packs properly and works but on every page. How can I get it to work only with a URL that