google-chrome-extension

Do elements created with document.createElement stay in memory?

穿精又带淫゛_ 提交于 2020-02-01 18:34:35
问题 Hi, I'm slowly making a chrome extension, and I need to parse some data that contains html entities, and I need to decode it. I saw in an answer here that I could use document.createElement for it, so I did this: htmlDecode: function(input) { if(/[<>]/.test(input)) { // To avoid creating tags like <script> :s return "Invalid Input"; } var e = document.createElement('div'); e.innerHTML = input; return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; } However I'm worried that

Insert CSS from Chrome Extension

谁都会走 提交于 2020-02-01 09:38:18
问题 I'm working on a chrome extension that allows the user to change the CSS of a page. I've attempted using the insertCSS method in the chrome.tabs api, and simply trying to append a style tag to the HTML, but i have not been successful. Can anyone tell me how either the insertCSS method works, or how to reach the web page from a .js file in the extension? 回答1: The injection code is simply chrome.tabs.insertCSS(tabId, { file : "mystyle.css" }); Make sure that mystyle.css is whiletlisted in the

Editing Built-in Chrome Bookmarks Manager Folder/Sub-Folder Auto-Expansion?

我的未来我决定 提交于 2020-01-31 05:10:27
问题 When using the the built-in bookmark manager in Chrome there is a navigation pane on the left which contains all the folders/sub-folders containing bookmarks. When one mouseovers a folder while dragging/dropping a folder/bookmark it auto-expands the folder (e.g. shows all sub-folders) after x period of time (400 ms). I'd like to make the variable that controls how long Chrome waits before auto-expanding the folder customizable. I found the code in Chromium that determines how long to wait

Building Chrome extension using xpath and Cross-Origin XMLHttpRequest

会有一股神秘感。 提交于 2020-01-30 10:58:08
问题 I'm currently trying to build my first Chrome extension but I'm having a slight issue with my code. I want to use XMLHTTPRequest and xpath to display a specific number from an external website as a badge on my icon. The code I'm using in my background.js file is as follows: var xhr = new XMLHttpRequest(); xhr.open("GET", "http://www.example.com", true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { // innerText does not let the attacker inject HTML elements. document

How to test Chrome extension for auto-update feature?

萝らか妹 提交于 2020-01-29 09:58:09
问题 I am about to finish my Google Chrome extension. If I'm not mistaking all Chrome apps come with a capability of auto-updating. If so, is there a way for me to test it before I submit my app to the Chrome Web Store? PS. Also do I need to account for any special conditions in my extension? 回答1: To test the updating procedure, it's best to submit your extension to the Web Store in a non-public fashion. As you publish an item, you have a choice of Public, Unlisted, and Trusted Testers publication

Chrome extension page action appearing outside of address bar

試著忘記壹切 提交于 2020-01-26 20:01:18
问题 I wrote a Chrome Extension page action, with the following implementation: In manifest.json: "permissions" : [ "declarativeContent" ], In background.js: chrome.runtime.onInstalled.addListener(function() { // Replace all rules ... chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { // With a new rule ... chrome.declarativeContent.onPageChanged.addRules([ { conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { urlMatches: 'www\.somewebsite\.com/

how download managers like IDM,orbit ,… disable built-in chrome download manager

我与影子孤独终老i 提交于 2020-01-25 21:00:48
问题 I want when download links clicked in chrome my own custom window showed instead showing built-in chrome download manager window. how? how disable built-in chrome download manager? I read entire chrome extension api document but doesn't found anything. thanks in advanced! 来源: https://stackoverflow.com/questions/32323278/how-download-managers-like-idm-orbit-disable-built-in-chrome-download-manag

how download managers like IDM,orbit ,… disable built-in chrome download manager

痞子三分冷 提交于 2020-01-25 20:59:59
问题 I want when download links clicked in chrome my own custom window showed instead showing built-in chrome download manager window. how? how disable built-in chrome download manager? I read entire chrome extension api document but doesn't found anything. thanks in advanced! 来源: https://stackoverflow.com/questions/32323278/how-download-managers-like-idm-orbit-disable-built-in-chrome-download-manag

Automated testing of Chrome extension notification

断了今生、忘了曾经 提交于 2020-01-25 18:01:48
问题 I have Selenium WebDriver + ChromeDriver successfully loading and interacting with my Chrome extension. My extension creates notifications, which I would like to be able to interact with from my automated tests, e.g. pressing a button on the notification. I take it this is not possible with Selenium, since notifications are not part of the DOM. Has anybody considered how they might include interactions with notifications when it comes to automated testing of Chrome extensions? 来源: https:/

Automated testing of Chrome extension notification

牧云@^-^@ 提交于 2020-01-25 18:01:32
问题 I have Selenium WebDriver + ChromeDriver successfully loading and interacting with my Chrome extension. My extension creates notifications, which I would like to be able to interact with from my automated tests, e.g. pressing a button on the notification. I take it this is not possible with Selenium, since notifications are not part of the DOM. Has anybody considered how they might include interactions with notifications when it comes to automated testing of Chrome extensions? 来源: https:/