Jump to content

Open current Safari tab in Chrome


Recommended Posts

Thanks. This one of those things I wouldn't have thought I needed, but it's actually quite handy. I use Safari as my main browser with full-on third-party script/frame/embed/object blocking via JavaScript Blocker. Sometimes it's easier just to open a page in Chrome than to try to figure out which blocked script is breaking the page.

Link to comment
  • 2 weeks later...

Which changes should be made to the script, to achieve the same result with Firefox? Replacing "Google Chrome" with "Firefox" opens Firefox but not the URL. (I'm a script newbie.) Any ideas? Thank you.

 

You can try to take a look a my workflow Send URL, it can open the url in a variety of apps (and in addition to Safari can also get the url from Chrome, Opera, Camino, iCab and Omniweb the browser just have to be the frontmost application)

 

 https://github.com/aiyodk/Alfred-Extensions/raw/master/AlfredApp_2.x/Send-URL/Send-URL.alfredworkflow

Link to comment
  • 1 month later...

I registered for the forum just to thank you for this. I prefer Safari as a browser, but when I'm troubleshooting a website I prefer to inspect elements in Chrome. This may only eliminate a few keystrokes, but they were keystrokes that I hated. Kudos.

Link to comment

Hi,

 

Unless Chrome is already opened, the workflow opens Chrome, but does not open the Safari url/active tab.

 

Is this a problem with the workflow, or something on my end?  :ph34r:

 

I use the below Applescript in a workflow to open the front Safari tab in Chrome and it seems to work fine for me whether Chrome is active or not.

 

I can't recall where I found this, or I would give credit, but I have been using this since the early days of Alfred 1.

on alfred_script(q)
tell application "Safari" to set currentURL to URL of current tab of window 1
tell application "Google Chrome"
	activate
	if not (exists window 1) then make new window
	tell window 1
		if URL of active tab is "chrome://newtab/" then
			set URL of active tab to currentURL
		else
			make new tab with properties {URL:currentURL}
		end if
	end tell
end tell
end alfred_script
Link to comment

Thanks for the script, Weaselboy. However, I managed to solve my problem in a similar fashion to you, by using the code from a V1 extension. Specifically, Daniel Kramer's Alfred V1 'open in chrome' extension.

 

 

 
property theURL : “”
 
tell application “Safari”
 
set theURL to URL of current tab of window 1
 
end tell
 
tell application “Google Chrome”
 
if (count of windows) is 0
make new window
else
make new tab at end of tabs of front window
end if
 
delay 1
 
set URL of active tab of front window to theURL
 
activate
 
end tell

 

 

If anyone wants to save themselves a couple of minutes, the workflow I cobbled together with the above code is here: http://d.pr/f/fVTW

Edited by Barrierfreeman
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...