Changeset 169057 in webkit
- Timestamp:
- May 19, 2014, 1:05:16 PM (12 years ago)
- Location:
- branches/safari-538.34.5-branch/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/Cocoa/WKUserContentController.mm (modified) (2 diffs)
-
UIProcess/API/Cocoa/WKUserScript.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-538.34.5-branch/Source/WebKit2/ChangeLog
r169056 r169057 1 2014-05-19 Lucas Forschler <lforschler@apple.com> 2 3 Merge r169000 4 5 2014-05-17 Anders Carlsson <andersca@apple.com> 6 7 Give user scripts custom URLs 8 https://bugs.webkit.org/show_bug.cgi?id=133035 9 10 Reviewed by Beth Dakin. 11 12 * UIProcess/API/Cocoa/WKUserContentController.mm: 13 (-[WKUserContentController addUserScript:]): 14 Create a user-script:<number> URL for user scripts. 15 16 * UIProcess/API/Cocoa/WKUserScript.h: 17 Move the init method after the properties. 18 1 19 2014-05-19 Lucas Forschler <lforschler@apple.com> 2 20 -
branches/safari-538.34.5-branch/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm
r169056 r169057 33 33 #import "_WKScriptWorld.h" 34 34 #import <WebCore/UserScript.h> 35 #import <wtf/text/StringBuilder.h> 35 36 36 37 @implementation WKUserContentController { … … 72 73 [_userScripts addObject:userScript]; 73 74 74 _userContentControllerProxy->addUserScript(WebCore::UserScript { userScript->_source.get(), WebCore::blankURL(), { }, { }, toWebCoreUserScriptInjectionTime(userScript->_injectionTime), userScript->_forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames }); 75 StringBuilder urlStringBuilder; 76 urlStringBuilder.append("user-script:"); 77 urlStringBuilder.appendNumber([_userScripts count]); 78 79 WebCore::URL url { WebCore::URL { }, urlStringBuilder.toString() }; 80 _userContentControllerProxy->addUserScript(WebCore::UserScript { userScript->_source.get(), url, { }, { }, toWebCoreUserScriptInjectionTime(userScript->_injectionTime), userScript->_forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames }); 75 81 } 76 82 -
branches/safari-538.34.5-branch/Source/WebKit2/UIProcess/API/Cocoa/WKUserScript.h
r169056 r169057 45 45 @interface WKUserScript : NSObject <NSCopying> 46 46 47 /*! @abstract Returns an initialized user script that can be added to a @link WKUserContentController @/link.48 @param source The script source.49 @param injectionTime When the script should be injected.50 @param forMainFrameOnly Whether the script should be injected into all frames or just the main frame.51 */52 - (instancetype)initWithSource:(NSString *)source injectionTime:(WKUserScriptInjectionTime)injectionTime forMainFrameOnly:(BOOL)forMainFrameOnly;53 54 47 /* @abstract The script source code. */ 55 48 @property (nonatomic, readonly) NSString *source; … … 61 54 @property (nonatomic, readonly, getter=isForMainFrameOnly) BOOL forMainFrameOnly; 62 55 56 /*! @abstract Returns an initialized user script that can be added to a @link WKUserContentController @/link. 57 @param source The script source. 58 @param injectionTime When the script should be injected. 59 @param forMainFrameOnly Whether the script should be injected into all frames or just the main frame. 60 */ 61 - (instancetype)initWithSource:(NSString *)source injectionTime:(WKUserScriptInjectionTime)injectionTime forMainFrameOnly:(BOOL)forMainFrameOnly; 62 63 63 @end 64 64
Note:
See TracChangeset
for help on using the changeset viewer.