google-chrome-extension

Unable to refresh new tab in my chrome extension

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:06:11
问题 In my chrome extension which replaces the new tab page, when I refresh the page it shows me file not found. Can anybody tell how to fix this issue? Is this has to do with either page history or file naming convention? I have index.html set in manifest.json: "chrome_url_overrides" : { "newtab": "index.html" } 回答1: Change <base href="/"> To <base href="/index.html"> And it works! 来源: https://stackoverflow.com/questions/41277357/unable-to-refresh-new-tab-in-my-chrome-extension

Chrome extension popup: running JavaScript, respond to button click

房东的猫 提交于 2019-12-25 08:00:08
问题 I seem to be having trouble running a script in my Chrome extension popup. Here is the info about my project first: The file popup.html contains a button with the id of newDetails and an <h1> tag with the class title : popup.html : <button id="newDetails">Click for details</button> <h1 class="title">Mr Sanderson</h1> In a file called background3.js , I have this script: $(document).ready(function() { console.log("Test"); document.getElementById("newDetails").addEventListener("click",

Chome extension: How to change behavior of a button inside a page?

廉价感情. 提交于 2019-12-25 07:39:11
问题 I'm pretty sure that this is a dumb question, but I'm struggling to find a helpful answer to that. I want to catch when the user creates a new event in Google Calendar to do some actions. So I imagined that I can do this by modifying the behavior of the "Create" button. Getting the button with jQuery and adding an event listener would be a good practice? I'm not completely confort with this approach because The HTML of the button could change in the future As the calendar is a Single Page App

Embedding YouTube video in Chrome extension

泪湿孤枕 提交于 2019-12-25 07:35:26
问题 I would like to embed a video hosted on YouTube and play it when the user clicks on a button in popup.html. I was following the solution listed here: Showing a YouTube video in a Google Chrome extension A new tab opens but I don't see the video, I only see a gray rectangle with a smiley inside. I guess Google is blocking the video somehow. Is it possible to show YouTube video on a new tab opened by background.js? Thanks EDIT: <div class="embed-responsive embed-responsive-16by9"> <iframe class

Selenium: How do I start Chrome with RailsPanel Extension loaded?

给你一囗甜甜゛ 提交于 2019-12-25 07:33:59
问题 What is the right way to do this? Capybara.register_driver :chrome do |app| client = Selenium::WebDriver::Remote::Http::Default.new extension_path = '/Users/jill/Documents/rails_panel-master/rails_panel' caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => ['--load-extension=' + extension_path]}) Capybara::Selenium::Driver.new(app, :browser => :chrome, http_client: client, desired_capabilities: caps ) end Also, --load-extension with switches worked, but there

Unable to get correct data from canvas getImageData

我的梦境 提交于 2019-12-25 07:32:03
问题 This is in continuation to question How to get pixel data from canvas which contains the screenshot generated by a chrome extension? and the source code is available here https://github.com/whizzzkid/ColorHelper-Chrome/ The issue I am facing here is, the color I was expecting it to output is not correct and seems to be rather random values. Any help on this will be appreciated. active = false; imgData = canvas = canvasContext = pixelData = ""; chrome.extension.onMessage.addListener(function

How to call chrome extension content script once upon entering domain

回眸只為那壹抹淺笑 提交于 2019-12-25 07:24:59
问题 I have a chrome extension that operates on multiple paths of a domain. The functionality I am trying to achieve is upon entering the domain (any of the paths) I call a content script (content_script_getdata.js) that parses the data and stores it in chrome.storage.local. After entering, navigation between the paths doesn't need to call content_script_getdata.js. Each path has it's own content script that gets from chrome.storage.local and updates the UI of that path based on the data. How can

How to store the values retrieved from content script into textboxes with a button click

风流意气都作罢 提交于 2019-12-25 07:03:48
问题 I am new to building chrome extension. I am using content script to retrieve the values. But Iam unable to load the values into the popup.html. Below is the code. popup.html <head> <script src="popup.js"></script> </head> <body> <form id="addbookmark"> <p><label for="title">Title</label><br /> <input type="text" id="title" name="title" size="50" value="" /></p> <p><label for="url">Url</label><br /> <input type="text" id="url" name="url" size="50" value="" /></p <p><label for="jsonName">Json

Use existing jQuery in Chrome extension content script?

萝らか妹 提交于 2019-12-25 07:02:55
问题 Everything I find seems to involve injecting jQuery, but I know jQuery already exists on the page (the browser JS console lets me use it). I have a background script that is sending a message to my content script, which is running the function. When that function executes I get: Error in event handler for runtime.onMessage: ReferenceError: jQuery is not defined (I've tried both $ and jQuery references) Any ideas why I cannot access the existing jquery object from the content script? 回答1: This

Can I access the content of an iframe in JavaScript that is part of a Google Chrome extension?

一曲冷凌霜 提交于 2019-12-25 06:52:44
问题 I have an iframe within the main window named "test_iframe". I want to access the content of "test_iframe" within a Google Chrome extension. I understand that I can do this if I have requisite permissions given in manifest.json . Can I access the content of this iframe from a background HTML page? Or can I access it in a content script which is part of that extension? (In the latter case I suppose I have to pass the iframe content from the content script to a background page as part of a