[alfred] Escape URLs in 'Open in Chrome' workflow

pull/28/head
Alpha Chen 9 years ago
parent 2a931b255c
commit 9cf585a801

@ -17,6 +17,17 @@
<string></string> <string></string>
</dict> </dict>
</array> </array>
<key>DC0E1A2B-DB5E-4AB4-9CFD-73ECD9B473DB</key>
<array>
<dict>
<key>destinationuid</key>
<string>24E5AD4A-C4E8-43EA-8FBF-47621D8A8829</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
</dict> </dict>
<key>createdby</key> <key>createdby</key>
<string>Alpha Chen</string> <string>Alpha Chen</string>
@ -31,13 +42,42 @@
<dict> <dict>
<key>config</key> <key>config</key>
<dict> <dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>2</integer>
<key>hotkey</key>
<integer>8</integer>
<key>hotmod</key>
<integer>1835008</integer>
<key>hotstring</key>
<string>C</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>DC0E1A2B-DB5E-4AB4-9CFD-73ECD9B473DB</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key> <key>escaping</key>
<integer>63</integer> <integer>63</integer>
<key>script</key> <key>script</key>
<string>url = ARGV.first || `pbpaste`.chomp <string>url = ARGV.first || `pbpaste`.chomp
# url = `pbpaste`.chomp if url.nil? || url.empty? # url = `pbpaste`.chomp if url.nil? || url.empty?
url = "http://#{url}" unless url =~ %r|^[\w]+://| url = "http://#{url}" unless url =~ %r|^[\w]+://|
`open -a "Google Chrome" #{url}`</string> `open -a "Google Chrome" "#{url}"`</string>
<key>type</key> <key>type</key>
<integer>2</integer> <integer>2</integer>
</dict> </dict>
@ -78,6 +118,11 @@ url = "http://#{url}" unless url =~ %r|^[\w]+://|
<real>10</real> <real>10</real>
</dict> </dict>
<key>98E2E165-F282-4876-AFF5-CD0DE474E024</key> <key>98E2E165-F282-4876-AFF5-CD0DE474E024</key>
<dict>
<key>ypos</key>
<real>80</real>
</dict>
<key>DC0E1A2B-DB5E-4AB4-9CFD-73ECD9B473DB</key>
<dict> <dict>
<key>ypos</key> <key>ypos</key>
<real>10</real> <real>10</real>

Loading…
Cancel
Save