Tuesday 15 April 2014

batch file - Open URL with a set Target -


Edit: The solution I want is a command line to complete it Can be run batch file in windows.


How do I copy a browser function to open a URL with a specific goal so that the tab is already open, will it load instead of creating a new tab?

Therefore, instead of default with the target "_blank", I can change it to "w00t" etc.

I am using only chrome, so if it is a chrome specific order, which will be acceptable.

You can create an HTML-page and add the following code like this:

  & lt; Script & gt; Var url = getQueryVariable ("url"); Var target = getQueryVariable ("target"); Window.open (url, target); Function getQueryVariable (variable) {var query = window.location.search.substring (1); Var vars = query.split ("& amp;"); (Var i = 0; i & lt; vars.length; i ++) for {var pair = vars [i] .split ("="); If (pair [0] == variable) {return pair [1]; }} & Lt; / Script & gt;  

I have to host this script:

You can tell it from this batch file:

  START Scriptcoded.github .o / redirect? Url = http: //www.google.com& target = w00t  

Use url = http: //www.google.com& Target = _blank to set the redirect.

The problem I have with this method is that some browsers block new windows and tabs will not be closed. Yes, we use the window.close (); , but it will only close the tabs that were opened by the webpage.

Hope it helps!


No comments:

Post a Comment