Chrome: Bookmark / Bookmarklet to open a URL with clipboard-Content - google-chrome

Is there a way to dynamically include clipboard content into a URL of a Bookmark / Bookmarklet in Chrome?
For example, i copy a story number ("test-1234") and want to open it in jira, it would be helpful i could just click the bookmark, something like this:
https://jira.mydomain.com/browse/{clipboardContent}
and it would open the URL:
https://jira.mydomain.com/browse/test-1234
Or is there a chrome-extension that would make it possible?

With chrome.contexMenu API you can select any text ("test-1234") from any web page
and activate a function (present in the contextual menu)
that opens a new tab (or window) with an URL constructed by the fixed part and the parameter in the queue.
You have to grant "contextMenu" and "activeTab" in your manifest.
For further details please read: https://developer.chrome.com/docs/extensions/reference/contextMenus/

I'm doing since years exactly what you've described, but I'm on MacOS and for this I'm using Alfred App (https://www.alfredapp.com). I've created an own Workflow for this. If you're on WIN, then there is something which could be similar to Alfred App --> https://github.com/Wox-launcher/Wox

Related

Get Chrome to open Google Cloud Storage links

I would like to be able to open a tab in Chrome and enter something like gs://bucket-name/path/to/file and have it open the corresponding page in the GCP Web Console https://console.cloud.google.com/storage/browser/bucket-name/path/to/file. I saw there are external protocol handlers in Chrome, but I don't want to open an external application. I just want it to open another page based on the URI. I also don't want to put up any of my own servers for this simple purpose. Perhaps a Chrome Extension that can do some simple JS on the URI after I enter it into the address bar?
I think it is possible now with link you gave (works for me).
#shiv turned my attention on fact that this is question about automated link replacement under the hood in address bar when you write "gs://bucket-...". So such handler just collects address and modifies it and uses modified version to go further.
Well then looks like you need something like this Set custom protocol handler in Firefox? (in case of Firefox) but unfortunately I cannot help more.

Is there a way to stop Google Chrome from showing most visited sites on a blank tab?

Whenever I open a new tab in Google Chrome I see the Google search bar plus 8 thumbnails of recently visited (or most visited) sites. I never click on the thumbnails and find them to be annoying. Is there anyway to disable this in Chrome?
I can think of a hacky workaround like creating a blank page someplace and setting that to be the new tab page, but there must be a better way. Any ideas?
Since nobody answered I thought I would post and answer to my question:
Use the Empty New Tab Page extension for a new blank tab instead of the default new tab.
There are also some redirect extensions such as Momentum, which loads a different full screen image each day.
type chrome://flags then Disable "Top Sites from Site Engagement"
Chrome allows extensions to run on chrome:// urls so one such possible future solution is if AdBlock explicitly requests the permission to run on chrome://newtab then you can just block the div with id most-visited. But currently AdBlock does not request this permission.
You could edit the manifest of AdBlock manually to include this permission or suggest it as a future feature.
The default new tap page's url is chrome-search://local-ntp/local-ntp.html. You can press F12 to check it. It's a local resource located in
C:\Program Files (x86)\Google\Chrome\Application\{Version}\resources.pak
or
C:\Users\%username%\AppData\Local\Google\Chrome\Application\{Version}\resources.pak
Open it with a HEX editor, search text
cur.style.opacity = 1.0
, and replace it with
cur.style.opacity = 0.0
Tested on Chrome 77.0.3865.90 .

How to open Chrome App from web link

I'm trying to create just a simple html link to open a Chrome app when clicking it. Lets use the following example:
I have installed the app found at https://chrome.google.com/webstore/detail/videostream-for-google-ch/cnciopoikihiagdjbjpnocolokfelagl
If I open the app from the Chrome menus, it will open the app in a new browser tab, displaying chrome-extension://cnciopoikihiagdjbjpnocolokfelagl/app.html as the URL in the address field.
So, naively I thought that I could just specify that URL to make it open if the link is clicked, i.e:
Link to the installed Chrome App
But that does not work. How should I do to link correctly to the (installed) app?
If you were in control of the app in question, you could use externally_connectable property and listen for requests to launch your app.
But it seems like you don't control that app. Normal webpage code is unprivileged and cannot call chrome-extension:// URLs and the like.
You could potentially make a launcher extension. Using the management API you can launch the app with
chrome.management.launchApp("cnciopoikihiagdjbjpnocolokfelagl");
and that can, again, be triggered via web-to-extension messaging using externally_connectable. But that obviously requires that your users have two distinct Chrome add-ons installed, the app in question and your launcher shim.
url_handlers
If you are the owner of the app I recommend using url_handlers.
These need to be registered in your apps manifest.json.
...
"url_handlers": {
"openApp": {
"matches": [
"https://www.yourVerifiedDomain.com/openApp"
],
"title": "Open App"
},
}
...
Then you could launch the app with a simple link anywhere on the web or in an extension.
Open App
management permission
If you are not the owner of the app you'll need the management permission as Xan already pointed out:
chrome.management.launchApp("<appId>");
I have an alternative solution. My use case is I've written a Chrome App, that I need customers to use once, and only once. I was trying to figure out a friendly way to preclude these steps:
Click on the three bar Icon in Chrome
Click on More Tools
Click on Extensions
Scroll to the bottom, click on Get More Extensions
blah, blah, blah.
Instead you can look up your custom Chrome App at the Google Chrome Web Store, and get the web store link.
Heres the link, using the Chrome App mentioned in the original question above.
https://chrome.google.com/webstore/detail/videostream-for-google-ch/cnciopoikihiagdjbjpnocolokfelagl
That's pretty handy if you've never seen the Chrome App before. For my situation, that's all I really need. Info offered here (1.5 years after original question answered) in case somebody else has a similar need. And here's the link to the Chrome App store:
https://chrome.google.com/webstore/category/apps

Is there anyway to install an extention without visiting to google app store?

Is there anyway to install an extention without visiting to google app store?
For example I want visitors, can install my extention just one clicking a facebook ad or a banner?
Is it possible?
I read some article that mentioning about to verified site ownership to do this. But I want to make advertisement on facebook so I wouldn't be owner of the web page...
Does anyone have information on this subject?
Thanks.
Right click on the Chrome shortcut
In the Target field, add --enable-easy-off-store-extension-install after what's already there, let a space before
Save and start Chrome
You're probably looking for inline installation, performed via chrome.webstore.install.
In your webpage:
include <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/itemID">, where the URL is the address of your extension
then. call chrome.webstore.install().
Unfortunately, you can't do either of those things on a basic Facebook page, but you could do it on a web page you can fully control.

Google Chrome extension - to open new tab directed to url when a certain url is searched in current tab?

I am very new (started today) to writing chrome extensions but need to write a 'fairly simple' one for tomorrow...
I am really struggling to get my head round it though!
I need to write an extension that opens a new tab or window (whichever is easier!) directed at a predefined url is opened when a certain URL is searched in the current.
An example of this would be if the user typed in www.facebook.com I am trying to get the extension to then open a new tab/window with www.google.com in.
Any help would be much appreciated!
Thanks
Will
In your html of the extension you can specify an anchor tag for the action button which opens a new tab like this
content of the anchor
or if you want to do it programmatically you can
window.open('http://google.com','_newtab');
You cant get at the contents of the omnibox unless you use the omnibox api, which means they have to specify your keyword first before your extension can get at the contents. You could make it open another page once they have gone to a url. You could use a content script that has a matches field that matches the page your interested in and then open a page accordingly.
Content Scripts
http://code.google.com/chrome/extensions/content_scripts.html
Tabs
You can use the tab api to get the current tabs details if your not in a content script. If you are in a content script you can use window.location as stated by Encore PTL. You can also use the tab api to open a tab.
http://code.google.com/chrome/extensions/tabs.html