google-chrome-extension

How to disable chrome alert notification?

家住魔仙堡 提交于 2020-07-20 04:03:15
问题 I need to turn alert notification off by my extension. The alert function is a javascript built-in function and i override it like below in content script but it still works. content script: window.alert = function(){} It does not turn it off. The problem is realy simple but it does not work and i am going crazy :) manifest.json: "content_scripts": [ { "js": [ "assets/js/jquery-1.12.4.min.js", "assets/js/common.js", "assets/js/handlers.js" ], "matches": [ "http://*/*", "https://*/*" ], "run

Wasm module compile error in Chrome Extension

倖福魔咒の 提交于 2020-07-18 03:54:53
问题 In my extension I want to use my own WebAssembly module. After loading my module (to background.html , or popup.html ), I catch the compile error: CompileError: WebAssembly.compile(): Wasm code generation disallowed by embedder. Are wasm modules not supported in Chrome Extensions? 回答1: It seems from this issue that Chrome requires script-src: 'unsafe-eval' CSP directive be active for WebAssembly compilation. See this discussion as to why this is the case, at least for now. Chrome Extensions

How to redirect URLs using chrome.webRequest API?

我与影子孤独终老i 提交于 2020-07-15 09:28:44
问题 background.js: chrome.webRequest.onBeforeRequest.addListener(function (details) { console.log(details.url); window.location.href = 'http://time.com/'; }, {urls: ['<all_urls>']}, []); It shows all requests in the console when I visit a web site, but it doesn't redirect the site to time.com. Additional Information: I got error on background console here: Error in event handler for webRequest.onHeadersReceived/1: ReferenceError: url is not defined at chrome.webRequest.onHeadersReceived

Getting the current time of the youtube video playing

僤鯓⒐⒋嵵緔 提交于 2020-07-10 10:48:19
问题 So I am developing a chrome extension. I am trying to get the Youtube video current playing time I am aware that there are many similar questions asked in other posts, but none of their code works for me My code is like this, I have to inject my code to the content script first chrome.tab.query({highlighted: true}, tabs => { tab = tabs[0] chrome.tabs.executeScript(tab.id, {code: "temp = document.getElementById('movie_player'); alert(temp); alert(temp.getCurrentTime());"}, respond => {}); } So

Chrome Extension - Find out if extension tab is open

故事扮演 提交于 2020-07-09 05:52:08
问题 I have set up that when I click extn icon - my extn index.html opens. If I click the icon a second time - I don't want it to open a second tab; I want it to focus the already open tab (if it's open). The problem is with if it's open part. Ideally, I would not want to ask for a tabs permission, as it is very intrusive. Because of this restriction I cannot iterate all the open tabs and check their urls. I tried storing extn tab id in chrome.local.storage and checking for it when I click the

Chrome Extension: close background page after closing Chrome

时光怂恿深爱的人放手 提交于 2020-07-08 05:51:02
问题 I have an extension with a background page, and by default this causes Chrome to persist after you close all windows, and puts the Chrome icon in the system-tray. I would like to avoid this -- I do not want my extension to cause the Chrome process to persist after closing all Chrome windows, nor do I want to cause Chrome to appear in the systray. According to the only docs I could find on this indicates that the user can set this option globally across all extensions, but that isn't what I'm

Chrome Extension: close background page after closing Chrome

感情迁移 提交于 2020-07-08 05:49:26
问题 I have an extension with a background page, and by default this causes Chrome to persist after you close all windows, and puts the Chrome icon in the system-tray. I would like to avoid this -- I do not want my extension to cause the Chrome process to persist after closing all Chrome windows, nor do I want to cause Chrome to appear in the systray. According to the only docs I could find on this indicates that the user can set this option globally across all extensions, but that isn't what I'm

Vue.js is detected on this page. Devtools inspection is not available because it's in production mode or explicitly disabled by the author

↘锁芯ラ 提交于 2020-07-05 06:00:08
问题 I'm trying to enable vue-devtools in Google Chrome. But I cannot enable it. I'm using vue.js inside the Laravel application. My server runs using php artisan serve command. 回答1: If the page uses a production/minified build of Vue.js, devtools inspection is disabled by default so the Vue pane won't show up. To make it work for pages opened via file:// protocol, you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel. I had to restart the chrome,

How can I use navigator.clipboard.readText() in a Chrome extension?

☆樱花仙子☆ 提交于 2020-07-03 07:59:02
问题 I wrote a Firefox extension that reads the clipboard and if it has some PEM certificate, it will print it's details in a new tab. I'm trying to port to Chrome. It does not work. What am I doing wrong? I asked for the clipboardRead in manifest.json and I run this in background script and it works fine in Firefox. navigator.clipboard.readText().then(function (textFromClipboard) { //do stuff with textFromClipboard }); This fails in Chrome with "Failed to execute 'readText' on 'Clipboard':

How can I use navigator.clipboard.readText() in a Chrome extension?

荒凉一梦 提交于 2020-07-03 07:57:49
问题 I wrote a Firefox extension that reads the clipboard and if it has some PEM certificate, it will print it's details in a new tab. I'm trying to port to Chrome. It does not work. What am I doing wrong? I asked for the clipboardRead in manifest.json and I run this in background script and it works fine in Firefox. navigator.clipboard.readText().then(function (textFromClipboard) { //do stuff with textFromClipboard }); This fails in Chrome with "Failed to execute 'readText' on 'Clipboard':