File tree 3 files changed +20
-2
lines changed
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ THE SOFTWARE.
37
37
- (void ) _migrateWhitelist ;
38
38
- (void ) _addWhitelistObserver ;
39
39
- (BOOL ) _isHostWhitelisted ;
40
+ - (BOOL ) _isWhiteListedForHostString : (NSString *)hostString ;
40
41
- (void ) _abortAlert ;
41
42
- (void ) _askToAddCurrentSiteToWhitelist ;
42
43
Original file line number Diff line number Diff line change @@ -149,8 +149,13 @@ - (void) _addToWhitelistAlertDidEnd: (NSAlert *)alert returnCode: (int)returnCod
149
149
150
150
- (BOOL ) _isHostWhitelisted
151
151
{
152
- NSArray *hostWhitelist = [[NSUserDefaults standardUserDefaults ] arrayForKey: sHostSiteInfoDefaultsKey ];
153
- return hostWhitelist && itemForSite (hostWhitelist, self.host ) != nil ;
152
+ return [self _isWhiteListedForHostString: self .host];
153
+ }
154
+
155
+ - (BOOL ) _isWhiteListedForHostString : (NSString *)hostString
156
+ {
157
+ NSArray *hostWhitelist = [[NSUserDefaults standardUserDefaults ] arrayForKey: sHostSiteInfoDefaultsKey ];
158
+ return hostWhitelist && itemForSite (hostWhitelist, hostString) != nil ;
154
159
}
155
160
156
161
- (NSMutableArray *) _mutableSiteInfo
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ - (id) initWithArguments:(NSDictionary *)arguments
86
86
{
87
87
self = [super init ];
88
88
if (self) {
89
+
89
90
self.webView = [[[arguments objectForKey: WebPlugInContainerKey ] webFrame ] webView ];
90
91
91
92
self.container = [arguments objectForKey: WebPlugInContainingElementKey ];
@@ -106,6 +107,17 @@ - (id) initWithArguments:(NSDictionary *)arguments
106
107
}
107
108
}
108
109
110
+ // Check the SWF src URL itself against the whitelist (allows embbeded videos from whitelisted sites to play, e.g. YouTube)
111
+
112
+ if ( !loadFromWhiteList )
113
+ {
114
+ NSURL * swfSrc = [NSURL URLWithString: [[arguments objectForKey: WebPlugInAttributesKey ] objectForKey: @" src" ] ];
115
+
116
+ if ( [self _isWhiteListedForHostString: [swfSrc host ] ] )
117
+ {
118
+ loadFromWhiteList = true ;
119
+ }
120
+ }
109
121
110
122
// Check for sIFR
111
123
You can’t perform that action at this time.
0 commit comments