0

==== background ==== Sorry for the bother. I'm new to chrome extension development. I found that I was unable to inject js code in chrome://inspec/#device (the chrome build-in page) by using tabs.executeScript.

My requirements is that, I'm trying to auto-catch the web-view network requests and responses. I finished this by created a devtools extension.

Meantime, I need to auto-detect the device list in the "chrome://inspect/#device" page, then inject the js code to click the "inspect" link to launch the devtools instead of manually clicked every time.

=== Issues === 1. I tried add content scrips, add the "chrome:///" matches, not work. 2. I then tried add permissions of "chrome:///", not work either.

So, how do I inject javascript code to the chrome setting pages "chrome://inspect/#device"?

Best Regards, Lucas Luo

LucasLuo
  • 1
  • 2
  • Hi wOxxOm, thanks for the replay. I tried your steps, 1) when install extension, chrome told me `Invalid scheme for 'permissions[chrome://*/*]'`. 2) when running the ext, the parameter `state` in the callback function of `chrome.permissions.contains` is undefined, which means unable to get the `chrome://*/*`. – LucasLuo Jul 12 '16 at 03:25
  • actually it's unable to get the `chrome://*/*` permission on my side, always false when using `permissions: {original: ["chrome://*/*"]`. – LucasLuo Jul 12 '16 at 04:56
  • Changing a flag requires restarting the browser. – wOxxOm Jul 12 '16 at 05:16
  • I've changed the flag, still return false. – LucasLuo Jul 12 '16 at 06:24
  • also restarted browser. – LucasLuo Jul 12 '16 at 06:32
  • thanks, restart computer, works now. – LucasLuo Jul 12 '16 at 06:48
  • It means that the browser was running in background, so to exit it you should use the Exit command in the menu or terminate all `chrome` processes in a task manager. – wOxxOm Jul 12 '16 at 07:18

0 Answers0