Orange Blue Yellow

Registering new protocol

Mac OS X

Add Environment Variable

  1. Open ~/.bash_profile
sudo nano ~/.bash_profile
  1. Add the following line to the end of the file: (for example: PATH_TO_CHROME_PORTABLE as /HOME/<USER>/Desktop/Google\ Chrome.app)
export GLINTT_BROWSER_PROTOCOL ="PATH_TO_CHROME_PORTABLE"

Register protocol

  1. Open Script Editor

  2. Copy the following script.

on open location this_URL
    do shell script "open -a $GLINTT_BROWSER_PROTOCOL --args \"" & findAndReplaceInText(this_URL, "glintt://", "") & "\""
end open location

on findAndReplaceInText(theText, theSearchString, theReplacementString)
    set AppleScript's text item delimiters to theSearchString
    set theTextItems to every text item of theText
    set AppleScript's text item delimiters to theReplacementString
    set theText to theTextItems as string
    set AppleScript's text item delimiters to ""
    return theText
end findAndReplaceInText
  1. Export script as Application (File > Export… ) into Applications folder.

  2. Open generated application using “Show Package Contents”.
    Navigate into Contents folder. Edit Info.plist and add the following XML to the end of the document.

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>SysPref Handler</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>glintt</string>
    </array>
  </dict>
</array>
  1. Run the application.

Ubuntu

Add Environment Variable

  1. Open ~/.bashrc
sudo nano ~/.bashrc
  1. Add the following line to the end of the file, changing the path_to_runnable to the path where chrome portable is located: (for example: PATH_TO_CHROME_PORTABLE as <path_to_chrome_portable>)
export GLINTT_BROWSER_PROTOCOL ="PATH_TO_CHROME_PORTABLE"

Register protocol

  1. Create a script to handle the protocol. Add it to /usr/local/bin/. Save using the name glinttbrowserprotocol.
    As example, create the following script which gets as input the full url with the format glintt://www.google.com*, removes glintt:// from the string and opens the browser with the url provided.
fullUrl=$1
url=${fullUrl#glintt://}
$GLINTT_BROWSER_PROTOCOL $url
  1. Run the following command to give the required permissions:
sudo chmod a+x /usr/local/bin/glinttbrowserprotocol
  1. Create a desktop file to register the protocol and associate it to the handler created on previous step.
    The desktop file must be stored into /usr/share/applications/. Give it the name glinttbrowserprotocolapp.
    This file has the following layout:
[Desktop Entry]
Name=Proto name
Exec=/usr/local/bin/glinttbrowserprotocol %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/glintt;
  1. Run the following command to update the desktop scripts database:
sudo update-desktop-database

Windows

Add Environment Variable

  1. Open command prompt
    setx GLINTT_BROWSER_PROTOCOL "PATH_TO_CHROME_PORTABLE"

Register protocol

  1. Create a bat file with the following content. Save it as glintt_browser_protocol.bat.
set GLINTTADDRESS=%1
set GLINTTADDRESS=%GLINTTADDRESS:~10%
start %GLINTT_BROWSER_PROTOCOL% "%glinttaddress%"
  1. Save the following content as glinttbrowserprotocol.reg file. Change the PATH_TO_BAT_PROTOCOL variable to the path where glintt_browser_protocol.bat is stored.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\glintt]
@="URL: glintt"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\glintt\shell]

[HKEY_CLASSES_ROOT\glintt\shell\open]

[HKEY_CLASSES_ROOT\glintt\shell\open\command]
@="\"PATH_TO_BAT_PROTOCOL\" \"%1\""
  1. Run the file to register the protocol