WKPreferences.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
  14. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  15. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
  17. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  18. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  19. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  20. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  21. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  23. * THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #import <WebKit/WKFoundation.h>
  26. #import <CoreGraphics/CoreGraphics.h>
  27. #import <Foundation/Foundation.h>
  28. /*! A WKPreferences object encapsulates the preference settings for a web
  29. view. The preferences object associated with a web view is specified by
  30. its web view configuration.
  31. */
  32. WK_EXTERN API_AVAILABLE(macos(10.10), ios(8.0))
  33. @interface WKPreferences : NSObject <NSSecureCoding>
  34. /*! @abstract The minimum font size in points.
  35. @discussion The default value is 0.
  36. */
  37. @property (nonatomic) CGFloat minimumFontSize;
  38. /*! @abstract A Boolean value indicating whether JavaScript is enabled.
  39. @discussion The default value is YES.
  40. */
  41. @property (nonatomic) BOOL javaScriptEnabled;
  42. /*! @abstract A Boolean value indicating whether JavaScript can open
  43. windows without user interaction.
  44. @discussion The default value is NO in iOS and YES in OS X.
  45. */
  46. @property (nonatomic) BOOL javaScriptCanOpenWindowsAutomatically;
  47. /*! @abstract A Boolean value indicating whether warnings should be
  48. shown for suspected fraudulent content such as phishing or malware.
  49. @discussion The default value is YES. This feature is currently available
  50. in the following region: China.
  51. */
  52. @property (nonatomic, getter=isFraudulentWebsiteWarningEnabled) BOOL fraudulentWebsiteWarningEnabled API_AVAILABLE(macos(10.15), ios(13.0));
  53. #if !TARGET_OS_IPHONE
  54. /*!
  55. @property tabFocusesLinks
  56. @abstract If tabFocusesLinks is YES, the tab key will focus links and form controls.
  57. The Option key temporarily reverses this preference.
  58. */
  59. @property (nonatomic) BOOL tabFocusesLinks API_AVAILABLE(macos(10.12.3));
  60. #endif
  61. @end
  62. @interface WKPreferences (WKDeprecated)
  63. @property (nonatomic) BOOL javaEnabled API_DEPRECATED("Java is no longer supported", macos(10.10, 10.15));
  64. @property (nonatomic) BOOL plugInsEnabled API_DEPRECATED("Plug-ins are no longer supported", macos(10.10, 10.15));
  65. @end