google-chrome: making the start page be an extension (not an app)? - google-chrome

Is there any way to start up the google-chrome browser so that an extension (not an app) gets launched as its start page?
I know I can do the following, but it only works if app-id refers to an installed app, not an installed extension ...
chrome --app-id=XXXXXXXXXXXXXXXXXXXXX
If the specified app-id is the ID of an installed extension (not an app), then chrome doesn't launch it.
Is it even possible to launch an extension as chrome's start page?
Thank you in advance.
CORRECTION: I am referring to the start page, and I have clarified the wording of this question accordingly.

I figured out how to do it, with the help of wOxxOm ...
chrome chome-extension://XXXXXXXXXXXXXXXXXXXXX/index.html
This works for all extensions that have some sort of HTML page for their startup. For the extension I'm dealing with, this is index.html, but different extensions might have different HTML startup pages.
I see now that the URL with the reference to the HTML file is simply the extension ID followed by a slash, followied by the HTML file name. I was previously trying it incorrectly with the extension's version number as part of the path.
And to be clear, some extensions do not have HTML startup pages, and they therefore cannot be invoked in this manner.

Related

Browser plugin/extension to track search string

I need to develop some sort of browser plugin/extension to track search string on some search engine web site, ex: google.com, bing.com.
From the research, for chrome extension, I saw somebody suggest content js is the way to go. Is it true? Is there a cross-browser approach?
You can use Content.JS or any other JS library you like for developing an extension but with only JS library you cannot develop an extension.
There is a specific way for each browser. It contains at least 4 files.
(1) Manifest file (2) HTML file (3) JS file (4) CSS file
You also need to refer browsers object model.
You can refer links below may help you to get more information.
(1) Creating a Microsoft Edge extension
(2) Getting Started Tutorial to create an extension for Chrome
(3) Your first extension for FireFox
To support cross browser functionality, You can try to port your chrome extension to Firefox or MS Edge. To get more information on porting an extension, you can refer links below.
(1) Porting an extension from Chrome to Microsoft Edge
(2) Porting a Google Chrome extension
Note:- You also need to refer policy of each browser to access browsing data of users. It can be possible that all browser has some difference in their policies.

How to test published Chrome Extension

When I develop a Chrome Extension locally, its icon is in the browser action bar. When I install a published version of my extension, there are now two of the same icons in the browser action bar. Sometimes I can't remember which is which.
If I open an incognito browser tab, I can't seem to load any extensions. But what I want to do is test my published extension in a sandbox, where I know I have the latest version.
What is the best way to test a published extension on the same machine where you develop the extension?
One way would be to create a new profile in Chrome to test your local extension.
You can also drag and drop the browser action items, so you could move the development extension all the way to the left and the published one all the way to the right.
I currently have installed 4 versions of a Chrome extension I'm developing:
One loaded from the unpacked source files, for debugging
One loaded from the minified code in a build directory, for testing how speedy it feels in day-to-day use
The published version installed from the webstore
A completely separate test version installed from the webstore
As Matt suggests, I've rearranged the icons on the Chrome toolbar, putting the minified version on the left, then the source version, then the ones from the webstore.
But this can still be a bit confusing, so I've also changed the build process a bit. The manifest.json now sets both the name and browser_action.default_title fields to "My Extension DEV". This string is shown in the tooltip of the version I've loaded from the source directory.
During the minification process, I have the build script change these values to "My Extension OUT (build time)", so I can see when the minified version was last built in the tooltip.
The script that actually packages the minified files into a .zip file for upload to the webstore then resets these values to what the published extension should show.
You could also change these strings at runtime instead of as part of the build process. If you have a background page, it could call chrome.management.getSelf() and then check the response's installType key. If it's "development", then you could call chrome.browserAction.setTitle("DEV") to indicate in the tooltip that it's the unpacked version of the extension.

How to apply a fix to an installed chrome extension?

I am using a popup blocker named JavaScript Popup Blocker.
Sometimes this extension becomes broken, I have to reinstall it (e.g. it breaks when I add a website with a URL like http://xxxx:6666/).
Today, it happen again and I decided to fix the error (last update is in 2013, it seems that author would not fix this error in future). I found the extension folder by chrome extension ID, and made some changes to the source code.
But Chrome says this extension is broken and needs fixing after I restart Chrome. I even repacked the extension and installed again, it still doesn't work.
Ok, I found the answer myself.
Remove key in manifest.json, remove the _metadata folder as well(as Xan suggest), then repack the extension.
Then Chrome would not say this extension is broken after installing.

Is it possible to have a customizable Chrome (or Chromium) installation file?

I added two extensions to my google chrome that I want to send to some extern users, which are not "technical" people (I mean that they don't have IT skills). Instead of showing them how they can download and add an extension to their google chrome, I want to simplify this task by sending them an installation file of chrome (or chromium) which already contains these two extensions. So, in this case, the only thing that they have to do is just to do a normal installation (with the .exe file since they use only windows) like there are installing a normal google chrome! After that, they will have a chrome which already includes these two extensions.
Can you tall me how can I do that? because I have no idea of it..
Thank you!!
Chrome has instruction for doing this here: https://developer.chrome.com/extensions/external_extensions. You should be able to do it via a registry addition.
Note, as of Chrome 33, you will need to publish the extension to the store, and you just add update urls. Chrome does not allow installation otherwise for security reasons.

How Chrome App (not Extension) can read DOM element of page hosting app install button

For my Chrome App, I followed Using Inline Installation guide, and when a website user clicks the installation button the app gets installed.
At the installation time (i.e. chrome.runtime.onInstalled.addListener(function() {}) in background.js), how can the app read a value (of DOM element or JavaScript variable - an ID of the logged in site visitor) from the HTML page hosting the installation button?
All online advise I found, is to use content scripts for extensions. The above-mentioned guide says: "Extensions can communicate with the embedding page via content scripts".
What is a solution for apps?
Sorry, but I don't believe that apps are able to get to the underlying page that they are installed from at all. The idea is that they should be sandboxed in their own private universe and not be able to affect anything outside their own window.
Extensions, on the other hand, are made to be able to access DOM of web pages.
So, I believe to do what you ask you will need to make an extension instead of an app.
If you just need to communicate some small piece of information from the web page to your app, look for another (out of band) method to do this.