| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ | 5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ |
| 6 #define IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ | 6 #define IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #import "cwv_export.h" |
| 11 |
| 10 // User Script to be injected into main frame of CWVWebView after | 12 // User Script to be injected into main frame of CWVWebView after |
| 11 // window.document is created, but before other content is loaded (i.e., at the | 13 // window.document is created, but before other content is loaded (i.e., at the |
| 12 // same timing as WKUserScriptInjectionTimeAtDocumentStart). | 14 // same timing as WKUserScriptInjectionTimeAtDocumentStart). |
| 15 CWV_EXPORT |
| 13 @interface CWVUserScript : NSObject | 16 @interface CWVUserScript : NSObject |
| 14 | 17 |
| 15 // JavaScript source code. | 18 // JavaScript source code. |
| 16 @property(nonatomic, copy, readonly, nonnull) NSString* source; | 19 @property(nonatomic, copy, readonly, nonnull) NSString* source; |
| 17 | 20 |
| 18 - (nonnull instancetype)init NS_UNAVAILABLE; | 21 - (nonnull instancetype)init NS_UNAVAILABLE; |
| 19 | 22 |
| 20 - (nonnull instancetype)initWithSource:(nonnull NSString*)source; | 23 - (nonnull instancetype)initWithSource:(nonnull NSString*)source; |
| 21 | 24 |
| 22 @end | 25 @end |
| 23 | 26 |
| 24 #endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ | 27 #endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_ |
| OLD | NEW |