Open chrome://extensions from web using link - google-chrome-extension

I have an chrome extension that might be disabled by the user. I want to create a link to the chrome://extensions menu in that case. It would be something like
Chrome extensions
which is not allowed: Not allowed to load local resource: chrome://extensions/
Most of the solutions I have read imply the use of an extension (which for this use case will be disabled):
chrome.tabs.create({'url': 'chrome://extensions'});
Is there any way to solve this issue?
Of course, I might be wrong... In that case, what could I do?
Thanks in advance

No. There exist privileged URLs and they cannot be opened from web pages or the command line.

Related

How to make a Chrome Extension available on all tabs while on development (unpacked)?

I just started developing a small Chrome extension, and following the https://developer.chrome.com/extensions/getstarted tutorial, I tried to find a way so that even in developer mode, the extension can be clickable on all tabs.
Right now, the extension is clickable only on pages under developer.chrome.com host.
It's probably a silly question, but do we have the possibility to test it, while on development, on other tabs (not under developer.chrome.com host)? If yes, how do we set this options? I try to add <all_tabs> permission in the manifest, but it doesn't seem to work.
Thanks!
The problem was that following this tutorial https://developer.chrome.com/extensions/getstarted, a rule is set in the background.js file that the browser action to execute on other pages.
I had to add the activeTab permission and delete code from background.js.
Credit to: https://www.sitepoint.com/create-chrome-extension-10-minutes-flat/
As available here https://developer.chrome.com/extensions/user_interface#browser_action, adding browser_action to your manifest.json as against adding page_action makes the extension available in all tabs.

Automating Google chrome extenions with sahi

We are automating chrome extension with sahi.
we have loaded our chrome profile with sahi with extension added on profile.
we weren't able to get dom elements of extensions.
so we are navigating to the url: chrome-extension:/extension_id/popup.html
but sahi doesn't navigate to this url.
but i have read with selenium we are able to get it.
Please help me out, with this automation
I'm not sure, I understand the problem here. But if you want to change some options on chrome. I use this Chromium Command Line Switches to find correct option to set when set browser on 'browser_types.xml`.
For example:
<options>--no-default-browser-check --user-data-dir=$userDir\browser\chrome\profiles\sahi$threadNo --proxy-server=127.0.0.1:$port --disable-popup-blocking --always-authorize-plugins --allow-outdated-plugins --enable-npapi --incognito</options>

Can you disable the welcome message that shows when a chrome extension is first installed?

Whenever a chrome extension is installed, Chrome shows a welcome message popup:
Is there any way for this to be disabled when building the extension?
I believe there is no way to do this, since obviously it's the default behavior of chrome, which means to let user know there is a new extension installed, how to manage extensions and to prevent extension is silently installed in background.
When building extension by ourselves, we can do something when extension is first installed, by listening to chrome.runtime.onInstalled event, usually we will popup a web page or navigate user to specific sites. However, we can determine if we need this behavior, but we can't change the default behavior of chrome browser extension.
chrome.runtime.onInstalled.addListener(function() {...});
Source developer.chrome.com
I do believe that this is a good place to start.

Can my chrome extension open a link in a different profile?

I use two different Chrome profiles (users) on my laptop: one for my work stuff and one for my personal browsing.
Sometimes I click a link from HipChat and it opens it in the personal profile even though it's for work (e.g. login.work.com). (This is because I happen to have been in my personal chrome window most recently.)
I'd like to make a chrome extension I can install in my personal profile to match the URLs of *.work.com and send these over to the work profile window.
I haven't found a way to open a url into a different profile. Anyone know of a way?
(A hacky idea I got from reading https://superuser.com/a/289618 is maybe I could shell out to something along the lines of google-chrome --user-data-dir=$work_profile, but I'd be happier if there was a JS API and I didn't have to ask permission to run programs on the user's computer.)
Dropping an answer in case it's still useful to anyone.
I built my chrome extension CopyTabs (https://chrome.google.com/webstore/detail/copytabs/obkbjogekcjalnaebheboejhfkamadkg) to do something similar. It is able to open links, current tabs, selected tabs or windows, in the current chrome user profile, another chrome user profile or another browser entirely.
I made use of chrome.exe --profile-directory="profileName" to open URLs in a selected profile, but this has a handler that runs on the user's machine, with profileName being the internal name of the chrome profile, for example --profile-directory="Profile1" instead of --profile-directory="My Name As Profile".
So to answer your question, no I don't think there's anyway around a local handler on the user's machine to achieve this functionality.
Though the question is an old one but maybe someone is looking for an answer.
In the new versions of chrome when you right click on a link, in the pop-up menu, there is an option to open the link in another profile. For this to work, ofcourse, there need to be multiple user profiles in Chrome.
Works like a charm!
Hope it helps.
There is no solution for this. It would need a handler, a separate program, that captures the URL before it reaches Chrome, parses your preferences for which URLs go to which profile and then starts the specified Chrome installation with specified profile flags.
However, afaik, such a program does not exist (at least on Windows).
Further, Chrome cannot even select which profile out of many is selected, when Chrome is started from the OS "call URL to be opened" function and NOT started by user-activated clicking on a Chrome application shortcut (with specific profile selection instructions).
Naturally, the latter works 100% wonderfully on Firefox, which has built-in profile selector after the browser has been started, and regardless of which method was used to start Firefox (user click on Firefox icon or OS pipe of "open URL" to Firefox).
So; no solution in Chrome.
I believe that Account Surfer should be able to do the things that you're looking for. Here's an overview from Windows store:
Quickly switch between accounts and browsers with Account Surfer.
Decide what account or browser to use when opening the link.
Read more:
https://dospolov.com/posts/handle-chrome-profiles-with-account-surfer
https://trello.com/b/QOLCmlg3/account-surfer-roadmap
Yes u can:
install extension like this https://chrome.google.com/webstore/detail/open-in-ms-edge/mjoebkkejejidnkfdekpbooceogbapnf
copy address of profile (for example: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --profile-directory="Profile 2)
Insert it in settings of extension
profit
OR
Use Browser Chooser 2
The app finicky did the trick for me. You can check out this link for installation and configuration for the same.
Finicky example configuration

Specify web brower in href tag

Is there a way to specify the web browser to be used in a href tag ? For instance, I have the following URL and I need it to be opened with Firefox only :
LPO Vienne
Thanks for your advices !
Actually it is possible these days - at least in the case of Microsoft Edge. Check this out. Although agree with ProWebMonkey that usability issues still apply.
This is not possible. If it was it would have to work on the assumption the user would have that browser, so even if it was possible it would not be a very good solution.
You could always have a notification on the linked page, explaining the user should use a specific browser, if they are not already. This would be more user friendly and you could provide a link to download etc.
Not true at all. It is possible like this:
A HREF="microsoft-edge:http://www.yoururlgoeshere.com"
the call "microsoft-edge:" before the actual URL will force the link to open in that browser, assuming the browser is installed on the machine.

Resources