mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
This is done by setting the ‘disableJavaScriptAPI’ key to ‘true’ in the tmCommand file. The rationale behind this is that a command like “HTML → Show Preview” is using the HTML output view with user data which should not have access to the special TextMate JavaScript object, for example a user may have a `<script>` tag that loads JavaScript from a CDN, and such script would effectively have shell access to the user’s machine.
18 lines
870 B
Objective-C
18 lines
870 B
Objective-C
#include <oak/misc.h>
|
|
|
|
@interface OakHTMLOutputView : NSView
|
|
- (void)loadRequest:(NSURLRequest*)aRequest environment:(std::map<std::string, std::string> const&)anEnvironment autoScrolls:(BOOL)flag;
|
|
- (void)stopLoadingWithUserInteraction:(BOOL)askUserFlag completionHandler:(void(^)(BOOL didStop))handler;
|
|
- (void)setContent:(NSString*)someHTML;
|
|
|
|
@property (nonatomic) NSUUID* commandIdentifier; // UUID from initial load request
|
|
@property (nonatomic, getter = isRunningCommand, readonly) BOOL runningCommand;
|
|
@property (nonatomic, getter = isVisible, readonly) BOOL visible;
|
|
@property (nonatomic, getter = isReusable) BOOL reusable;
|
|
@property (nonatomic) BOOL disableJavaScriptAPI;
|
|
|
|
// Read-only access to the webview is given to allow reading page title, etc.
|
|
@property (nonatomic, readonly) WebView* webView;
|
|
@property (nonatomic, readonly) BOOL needsNewWebView;
|
|
@end
|