Chrome external application launch links - google-chrome

In Google Chrome, I can type the following in a new browser:
pycharm://open?file=file_name
and press Enter. The result is that PyCharm IDE will launch and open the specified file. I have also come across similar links that launch other applications.
I tried to look for information about such links but did not reach any conclusions. Specifically, I would like to know:
what is the name of such a link?
who defines those links? Since I cannot find any documentation about those links on PyCharm's side, I am led to think that those links are some form of standard command that work for every external application?
how do those links work under the hood? Is it the browser spawning a new subprocess or does the browser somehow communicate the command to the OS which takes it from there?
I can also do the above programmatically:
window.open('pycharm://open?file=file_name', '_top');
How can I ensure that the focus switches to the target application? (Right now the application does indeed start, but the focus stays on Chrome.)

Related

How to move the "re-frame-10x" window back to the browser tab after being popping out into a new window?

I have been using Clojure, ClojureScript, lein, shadow-cljs, re-frame, reagent, Emacs, and CIDER to work on a Clojure/ClojureScript dynamic web app project.
Usually, I build the project by executing the command cider-jack-in-cljs in Emacs, choosing shadow-cljs, then shadow for REPL type, and, finally, app for the building option.
The application loads in localhost:3005 with a debugging dashboard. Apparently, this UI is called "re-frame-10x":
After clicking on the up-right arrow icon on the top-right:
I managed to pop out the debugging dashboard into a new window in Google Chrome. It was injecting some CSS and hiding a button on the webpage. Hence, I decided to "remove it" by popping-it out.
But, I would like to move it back to the browser tab that has localhost on the address. How to do it?
As suggested by #eugene-pakhomov, it was just closing that window. I must highlight that I had tried that before, the only problem was that there were multiple windows of that type. And all of them need to be closed for the process to work!
Not sure why the program opens multiple windows...

iOS 9.2 breaks app protocol handling

I have a link in my app that points to an app protocol of type myProtocol://". Until a few days ago this was working completely fine, whenever you clicked on the link, the native app would open.
However, iOS9.2 seems to have broken this. Now what happens is when the links is clicked, I get a prompt to open the native app which disappears after roughly 1 second, not even close to giving the user enough time to access. Shortly afterwards I get prompted to go to the App Store to the app's page.
Any idea why this is happening and what changes in iOS9.2 that is causing this would be helpful.
It seems that with iOS9.2, Apple is making a move towards Universal Links and traditional deeplinking is not supported anymore. While I was not able to find any information published direct on iOS9.2 release notes, following links indicate the same:
https://blog.branch.io/ios-9.2-redirection-update-uri-scheme-and-universal-links
https://www.adjust.com/overview/features/2015/12/11/ios-9-2-deeplinking/

How to block a URL in Chrome's developer tools network monitor

I am currently analysing my page connections and I want to block some tracking scripts and other external URL calls in my network monitor inside Chrome's developer tools.
I quickly want to check how the page behaves without some libraries.
Chrome itself does not provide any functions like this and the famous blocking extensions only block URLs which the user enters manually into the navigation bar.
As pointed out by #calavera.info, #iman.Bahrampour, and #Asim K T this feature is now available in Chrome 59. You can select a URL or domain to block in the Network panel. See this release note and these Screenshots where the StackOverflow logo has been blocked from this page. #iman.Bahrampour also shares two extensions below that will also do this ("HTTP Request Blocker" and "Request Blocker").
As abd3721 mentioned this is available directly within chrome DevTools (You don't need to be on canary anymore), however it is still behind a flag and in the hidden experimental features menu. As of the time of this comment, Chrome stable is on version 53.
To enable it, open this link and click the enable link under the appropriate flag:
chrome://flags/#enable-devtools-experiments
Then in DevTools open up the settings panel(F1) and click on the experiments tab.
This lists all currently available DevTools experiments but it is still in yet another hidden set of features.
Press Shift 6 times while in the experiments tab to show even more hidden features, one of them will be Request Blocking.
NOTE: These features are considered experimental and may be buggy or incomplete. Use with caution.
For blocking requests in google chrome you have 3 options:
1. Google Chrome with pattern matching:
In network tab, right click on request and then select block request URL
There is a plus sign that adds patterns for blocking requests
For example I have 7 request URLs:
http://www.test.com?userid=5
http://www.test.com?username=username
http://www.test.com?email=email
http://www.test.com?name=x
http://www.test.com?family=q
http://www.test.com?family=y
http://www.test.com?family=z
I can block requests that have a specific pattern by adding a pattern(for example the pattern *family* blocks 3 below requests):
http://www.test.com?family=q
http://www.test.com?family=y
http://www.test.com?family=z
Be careful! Because patterns are case sensitive
2. HTTP Request Blocker extension:
This extension has pattern matching for blocking requests:
Match patterns
3. Request blocker extension:
This is a useful extension that has pattern matching for blocking requests.
The most useful features of this request blocker are importing and exporting lists for using by other People.
For exporting a list and using in another computer(or future used): click on Direction down and select Export.
Open the exported list with import list button.
Good Luck
From Chrome 59 you can block specific requests from Network tab of developer tools itself.
https://developers.google.com/web/updates/2017/04/devtools-release-notes#block-requests
Right-click on the request in the Network panel and select Block Request URL. A new Request blocking tab pops up in the Drawer, which lets you manage blocked requests.
This is now achievable in Chrome 59 developer tools by blocking respective requests: https://developers.google.com/web/updates/2017/04/devtools-release-notes#block-requests. With this approach it is somehow difficult to turn off all the stylesheets, but it's easier to turn off just the most annoying ones.
As for Google Chrome 94, it's possible to exclude network activity for entire domain:
1. Go to "Network" panel of DevTools:
2. Rigth click on item of domain you want to block, click on "Block request domain" in the context menu:
3. Type "status-code:0" into "Filter" and click on "Invert" checkbox:
To manage blocked domains, press ESC button when in DevTools, and click on "Network request blocking" tab in the bottom panel:
Will changing host file help.
Your system (windows, linux, mac) all check host before requesting DNS lookup. I use it when I wan tot block some slow advertisers.
windows:
c:\Windows\system32\drivers\etc\hosts
linux & mac
/etc/hosts
* BE VERY CAREFUL TO MAKE BACK UPS *
An existing bug report is requesting this feature. You can star that issue to show support for it being added.
Well, i have been looking for an answer for this too, as I had this issue of choices by counterfeit, and nothing seemed to work for me.
But then I tried to analyze the requests and other things until I figured out, that there was this site which was loading ads onto my pages and redirecting me to advertisements. And also changing the google search bar on new tabs to some unknown search engine. I was able to temporarily block the request on one page. but after opening a new tab, the ads would appear again.
So googling for request blocker, I came up with a chrome extension "HTTP Request Blocker" and added the address which was causing all the crazy ads, has now solved the problem fully.
I hope it will be of help to you too or anyone else.
In the original question, the author states:
the famous blocking extensions only block URLs which the user enters manually into the navigation bar.
This is no longer the case. I have really enjoyed using mokku, which can intercept and mock all types of requests. You can specify what the status code should be, so it will definitely solve this problem as well as adding other functionality that is helpful. It works by another tab in the chrome dev tools. Here is a link to the extension: https://chrome.google.com/webstore/detail/mokku-mock-api-calls-seam/llflfcikklhgamfmnjkgpdadpmdplmji?hl=en

accessing a chrome extension from outside the browser

Is it possible to access a Chrome Extension from outside the browser?
I would like to be able to run a command from my text editor (MacVim) that refreshes the page on which I am working. From reading the Chrome Extension documentation it looks like I could try something really hack-y, like opening a page that uses Chrome message passing to refresh another page, but there does not seem to be a strait-forward way to do this.
I am running Mac OS X. I've tried the shell command:
$ open <url>
But that opens a new tab every time in Chrome, so this doesn't help when I'm using the developer tools
You are right, there is no straight forward solution.
Your hacky approach is the simplest way to go. Only instead of messaging I would put a tab creation listener into background page, and when a tab with some special URL is created (http://example.com/?do=refresh) - close it and refresh the next selected tab. You will see new tab flickering, but that's as good as it gets.
You can also look into using WebSocket API, for which you would need to write a server side app (which you need to call from your editor somehow). Not sure how this all might turn out.

Creating Chrome popup with a C++ program

Problem context:
I have a C++ program and a web presence. Currently the way things are working I have made a control panel with javascript and html. And it send commands via an unimportant communication medium to control things or get information from the C++ program.
Now, when the C++ program launches, I'm making it run a
ShellExecute(NULL, "open", addressBuffer," --new-window", NULL, SW_NORMAL);
This is a way of launching the default browser with the given address. The addressBuffer in this case points to an intermediate HTML file that quickly turns around and uses the
window.open()
in Javascript to open the final popup, then closes itself.
The result is the user now has the popup control panel that I want them to have but the user's main browser window also gets given focus, un-minimized, and placed on a different tab than the one they had selected. (Basically pops up out of nowhere and selects a another tab)
Problem:
I'm looking for a way to launch a Chrome popup, without disturbing a previously open browser window. Any ideas or solutions would be very helpful.
Lastly, it's worth noting that the " --new-window" from the code above doesn't actually open a new window like you would expect. In this case it's actually doing nothing... If it did work, none of this would really be an issue.
I know this is wordy so thanks in advance for you time!
-Michael
Alright, I came up with a solution.
Something about how ShellExecute processes it's commands was preventing the command line args to be passed in correctly.
My work-around includes grabbing the path to Chrome from the registry,
HKET_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
Then simply doing a system() command with the chrome path "--new-window" and the web path.
Then I let the intermediate html page open it's popup and close itself.
Tada done.
Thanks.