Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Force a whitelist for URL schemes
Loading branch information
@@ -201,7 +201,26 @@ - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary
if (action == WebNavigationTypeLinkClicked ) {
[listener ignore ];
[TLOpenLink open :actionInformation[WebActionOriginalURLKey ]];
NSURL *actionURL = actionInformation[WebActionOriginalURLKey ];
if (NSObjectsAreEqual([actionURL scheme ], @" http" ) == NO &&
NSObjectsAreEqual ([actionURL scheme ], @" https" ) == NO &&
NSObjectsAreEqual([actionURL scheme ], @" textual" ) == NO)
{
BOOL openLink =
[TLOPopupPrompts dialogWindowWithMessage: TXTLS (@" BasicLanguage[1290][2]" )
title: TXTLS (@" BasicLanguage[1290][1]" , [actionURL absoluteString ])
defaultButton: TXTLS (@" BasicLanguage[1290][3]" )
alternateButton: TXTLS (@" BasicLanguage[1009]" )
suppressionKey: @" open_non_http_url_warning"
suppressionText: nil ];
if (openLink == NO ) {
return ;
}
}
[TLOpenLink open :actionURL];
} else {
[listener use ];
}
@@ -784,9 +784,14 @@
"BasicLanguage[1287][2]" = "Would you like to launch the “Textual Extras” installer to perform update?";
"BasicLanguage[1287][3]" = "Launch Installer";
/* Non-HTTP link warning */
"BasicLanguage[1290][1]" = "Please verify that you would like to open the following URL: %@";
"BasicLanguage[1290][2]" = "The linked you clicked will launch an application other than your web browser which could possibly lead to the leak of your personal information.";
"BasicLanguage[1290][3]" = "I Understand, Continue";
/* Next unusued key: 1290 */
/* Next unusued key: 1291 */
@@ -2,6 +2,20 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version =" 1.0" >
<dict >
<key >com.adiumX.AutoHyperlinks.permittedSchemes </key >
<array >
<string >feed </string >
<string >ftp </string >
<string >irc </string >
<string >ircs </string >
<string >itms </string >
<string >sftp </string >
<string >ssh </string >
<string >telnet </string >
<string >textual </string >
<string >webcal </string >
<string >x-man-page </string >
</array >
<key >-[NSString isValidInternetAddress] Performs Extended Validation </key >
<true />
<key >AutojoinMaximumChannelJoinCount </key >
Toggle all file notes