I’m writing a Chrome Extention to manipulate pdf file so I want to get selected text in the pdf. How can I do that. Some thing like that: Answer You can use the internal undocumented commands of the built-in PDF viewer. Here’s an example of a content script: This example assumes you send a message from the popup or background
Tag: google-chrome-extension
Ensure `click` event is seen by the content script
I’m writing an extension for Chrome that listen and capture the click events made by the user. This is the way I’m capturing the event It works good in many cases, but there’re other cases where click event never get triggered, instead there’re one or more focusout events that get triggered. I understad that focusout event may be shooted when
How to release chrome extension from GitHub repository
I have the code for my chrome extension on GitHub, which I want to publish on Chrome Store. Doing it manually once is fine, but I want to make an automated flow, where as soon as any commit comes to a release branch, chrome extension on the chrome store is also updated. Is there any documentation by any developer or
what is the purpose of chrome-extension inject.js
Hello I have a react project which is working full and functional but when I look into network form console I find an unexpected script called chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/inject.js which is not associated with my project. Is that a virus or an extension ?? In my chrome://extensions/ there is nothing called inject. Can anyone tell me what is this? This script loading
How to pass data from content script to popup.html?
I’m learning how to make chrome extensions. I have a content script that will obtain some data and I want to pass them to the popup.html page to display them on the popup DOM. I’ve read about the message passing in the Chrome documentation but I’m unable to make it work. Can anyone help me? My code: content script file:
page_action click does not work while browser_action click works in Chrome Extension?
I want to make a simple browser extension like Font Face Ninja which toggles UI when page_action or browser_action is clicked. The following code using browser_action works – background.js manifest.json While the following code using page_action does not work – background.js manifest.json According to MDN docs, Page actions are like browser actions, except that they are associated with particular web
Chrome Extension content_script at both document_start and document_end
Good day to everyone, as you can see I’m pretty new at Chrome extensions. Can you run a script from content_scripts before and after the the DOM or page fully loads? Like: Or something like: Answer You can have only one content_scripts entry, so it would be like: With this setting, content1.js would run at the beginning and content2.js at
Chrome extension getSelection not working
I am trying to create a chrome extension which only consist of a button. When this button is clicked, it should make an alert box which contains the highlighted textarea on a page. I can’t get it to work. I can make it alert a hardcoded string, but not make it alert some highlighted text / selected textarea on a
How to get YouTube URL in background?
For my school project, I need to extract Video URL from Youtube from a Chrome extension. It means I should play a video on Youtube and I need the URL of that video displayed in my chrome extension body. How should I get this video URL using Javascript? Answer window.location.href if you are on the page playing a video.
Creating Chrome Extension to Dismiss Notifications via Keyboard Shortcut
I’m new to Chrome extension development. I am currently looking to make a Chrome extension to dismiss notifications. I want the extension to be activated once via shortcut keys. Before looking at the code below, I want to let it be known that the alert does show up… but the Chrome Extensions page shows the error: “Error in event handler