nsIDocShellLoadInfo.idl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. /**
  8. * The nsIDocShellLoadInfo interface defines an interface for specifying
  9. * setup information used in a nsIDocShell::loadURI call.
  10. */
  11. interface nsIURI;
  12. interface nsIInputStream;
  13. interface nsISHEntry;
  14. interface nsIDocShell;
  15. interface nsIPrincipal;
  16. typedef long nsDocShellInfoLoadType;
  17. typedef unsigned long nsDocShellInfoReferrerPolicy;
  18. [scriptable, uuid(e7570e5a-f1d6-452d-b4f8-b35fdc63aa03)]
  19. interface nsIDocShellLoadInfo : nsISupports
  20. {
  21. /** This is the referrer for the load. */
  22. attribute nsIURI referrer;
  23. /**
  24. * The originalURI to be passed to nsIDocShell.internalLoad. May be null.
  25. */
  26. attribute nsIURI originalURI;
  27. /**
  28. * loadReplace flag to be passed to nsIDocShell.internalLoad.
  29. */
  30. attribute boolean loadReplace;
  31. /** The principal of the load, that is, the entity responsible for
  32. * causing the load to occur. In most cases the referrer and
  33. * the triggeringPrincipal's URI will be identical.
  34. */
  35. attribute nsIPrincipal triggeringPrincipal;
  36. /** If this attribute is true and no triggeringPrincipal is specified,
  37. * copy the principal from the referring document.
  38. */
  39. attribute boolean inheritPrincipal;
  40. /** If this attribute is true only ever use the principal specified
  41. * by the triggeringPrincipal and inheritPrincipal attributes.
  42. * If there are security reasons for why this is unsafe, such
  43. * as trying to use a systemprincipal as the triggeringPrincipal
  44. * for a content docshell the load fails.
  45. */
  46. attribute boolean principalIsExplicit;
  47. /**
  48. * If this attribute is true, then a top-level navigation
  49. * to a data URI will be allowed.
  50. */
  51. attribute boolean forceAllowDataURI;
  52. /* these are load type enums... */
  53. const long loadNormal = 0; // Normal Load
  54. const long loadNormalReplace = 1; // Normal Load but replaces current history slot
  55. const long loadHistory = 2; // Load from history
  56. const long loadReloadNormal = 3; // Reload
  57. const long loadReloadBypassCache = 4;
  58. const long loadReloadBypassProxy = 5;
  59. const long loadReloadBypassProxyAndCache = 6;
  60. const long loadLink = 7;
  61. const long loadRefresh = 8;
  62. const long loadReloadCharsetChange = 9;
  63. const long loadBypassHistory = 10;
  64. const long loadStopContent = 11;
  65. const long loadStopContentAndReplace = 12;
  66. const long loadNormalExternal = 13;
  67. const long loadNormalBypassCache = 14;
  68. const long loadNormalBypassProxy = 15;
  69. const long loadNormalBypassProxyAndCache = 16;
  70. const long loadPushState = 17; // history.pushState or replaceState
  71. const long loadReplaceBypassCache = 18;
  72. const long loadReloadMixedContent = 19;
  73. const long loadNormalAllowMixedContent = 20;
  74. /** Contains a load type as specified by the load* constants */
  75. attribute nsDocShellInfoLoadType loadType;
  76. /** SHEntry for this page */
  77. attribute nsISHEntry SHEntry;
  78. /** Target for load, like _content, _blank etc. */
  79. attribute wstring target;
  80. /** Post data */
  81. attribute nsIInputStream postDataStream;
  82. /** Additional headers */
  83. attribute nsIInputStream headersStream;
  84. /** True if the referrer should be sent, false if it shouldn't be
  85. * sent, even if it's available. This attribute defaults to true.
  86. */
  87. attribute boolean sendReferrer;
  88. /** Referrer policy for the load. This attribute holds one of
  89. * the values (REFERRER_POLICY_*) defined in nsIHttpChannel.
  90. */
  91. attribute nsDocShellInfoReferrerPolicy referrerPolicy;
  92. /** True if the docshell has been created to load an iframe where the
  93. * srcdoc attribute has been set. Set when srcdocData is specified.
  94. */
  95. readonly attribute boolean isSrcdocLoad;
  96. /** When set, the load will be interpreted as a srcdoc load, where contents
  97. * of this string will be loaded instead of the URI. Setting srcdocData
  98. * sets isSrcdocLoad to true
  99. */
  100. attribute AString srcdocData;
  101. /** When set, this is the Source Browsing Context for the navigation. */
  102. attribute nsIDocShell sourceDocShell;
  103. /**
  104. * Used for srcdoc loads to give view-source knowledge of the load's base
  105. * URI as this information isn't embedded in the load's URI.
  106. */
  107. attribute nsIURI baseURI;
  108. /**
  109. * This will be true if this load is triggered by attribute changes.
  110. * See nsILoadInfo.isFromProcessingFrameAttributes
  111. */
  112. attribute boolean isFromProcessingFrameAttributes;
  113. };