From dd4c0a44b6ea72358537f9072b7a72e08efe38a8 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 2 Aug 2023 02:41:40 -0500 Subject: [PATCH 01/10] Issue #2282 - - Properly implement Performance Timeline Level 2 w3c spec. https://bugzilla.mozilla.org/show_bug.cgi?id=1539006 Do not throw from PerformanceObserver.observe when none of the entryTypes are known. https://bugzilla.mozilla.org/show_bug.cgi?id=1403027 Implement PerformanceObserver::takeRecords(). https://bugzilla.mozilla.org/show_bug.cgi?id=1436692 "server" is not a valid PerformanceEntry type. https://bugzilla.mozilla.org/show_bug.cgi?id=1463065 Fix a null ptr crash in PerformanceObserver::Observe. https://bugzilla.mozilla.org/show_bug.cgi?id=1631346 --- dom/locales/en-US/chrome/dom/dom.properties | 2 + dom/performance/Performance.cpp | 18 +- dom/performance/PerformanceObserver.cpp | 230 ++++++++++++++++-- dom/performance/PerformanceObserver.h | 18 ++ .../tests/test_performance_observer.js | 14 +- dom/webidl/PerformanceObserver.webidl | 10 +- dom/workers/WorkerPrivate.cpp | 38 ++- dom/workers/WorkerPrivate.h | 3 + 8 files changed, 284 insertions(+), 49 deletions(-) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index 27b4eebf12..f0a6363af0 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -321,3 +321,5 @@ PushStateFloodingPrevented=Call to pushState or replaceState ignored due to exce # LOCALIZATION NOTE: Do not translate "Reload" ReloadFloodingPrevented=Call to Reload ignored due to excessive calls within a short timeframe. DOMQuadBoundsAttrWarning=DOMQuad.bounds is deprecated in favor of DOMQuad.getBounds() +UnsupportedEntryTypesIgnored=Ignoring unsupported entryTypes: %S. +AllEntryTypesIgnored=No valid entryTypes; aborting registration. diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 0217b20153..c903f3ec78 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -711,9 +711,21 @@ Performance::QueueEntry(PerformanceEntry* aEntry) if (mObservers.IsEmpty()) { return; } - NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, - PerformanceObserver, - QueueEntry, (aEntry)); + nsTObserverArray interestedObservers; + nsTObserverArray::ForwardIterator observerIt( + mObservers); + while (observerIt.HasMore()) { + PerformanceObserver* observer = observerIt.GetNext(); + if (observer->ObservesTypeOfEntry(aEntry)) { + interestedObservers.AppendElement(observer); + } + } + + if (interestedObservers.IsEmpty()) { + return; + } + + NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(interestedObservers, PerformanceObserver, QueueEntry, (aEntry)); if (!mPendingNotificationObserversTask) { RunNotificationObserversTask(); diff --git a/dom/performance/PerformanceObserver.cpp b/dom/performance/PerformanceObserver.cpp index 26f93e8fc1..5482c1f2a6 100644 --- a/dom/performance/PerformanceObserver.cpp +++ b/dom/performance/PerformanceObserver.cpp @@ -9,6 +9,7 @@ #include "mozilla/dom/PerformanceBinding.h" #include "mozilla/dom/PerformanceEntryBinding.h" #include "mozilla/dom/PerformanceObserverBinding.h" +#include "nsIScriptError.h" #include "nsPIDOMWindow.h" #include "nsQueryObject.h" #include "nsString.h" @@ -27,12 +28,14 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PerformanceObserver) NS_IMPL_CYCLE_COLLECTION_UNLINK(mCallback) NS_IMPL_CYCLE_COLLECTION_UNLINK(mPerformance) NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner) + NS_IMPL_CYCLE_COLLECTION_UNLINK(mQueuedEntries) NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PerformanceObserver) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallback) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPerformance) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mQueuedEntries) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(PerformanceObserver) @@ -43,10 +46,14 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PerformanceObserver) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END +const char UnsupportedEntryTypesIgnoredMsgId[] = "UnsupportedEntryTypesIgnored"; +const char AllEntryTypesIgnoredMsgId[] = "AllEntryTypesIgnored"; + PerformanceObserver::PerformanceObserver(nsPIDOMWindowInner* aOwner, PerformanceObserverCallback& aCb) : mOwner(aOwner) , mCallback(&aCb) + , mObserverType(ObserverTypeUndefined) , mConnected(false) { MOZ_ASSERT(mOwner); @@ -56,6 +63,7 @@ PerformanceObserver::PerformanceObserver(nsPIDOMWindowInner* aOwner, PerformanceObserver::PerformanceObserver(WorkerPrivate* aWorkerPrivate, PerformanceObserverCallback& aCb) : mCallback(&aCb) + , mObserverType(ObserverTypeUndefined) , mConnected(false) { MOZ_ASSERT(aWorkerPrivate); @@ -115,7 +123,8 @@ PerformanceObserver::Notify() mQueuedEntries.Clear(); ErrorResult rv; - mCallback->Call(this, *list, *this, rv); + RefPtr callback(mCallback); + callback->Call(this, *list, *this, rv); if (NS_WARN_IF(rv.Failed())) { rv.SuppressException(); } @@ -126,63 +135,227 @@ PerformanceObserver::QueueEntry(PerformanceEntry* aEntry) { MOZ_ASSERT(aEntry); - nsAutoString entryType; - aEntry->GetEntryType(entryType); - if (!mEntryTypes.Contains(entryType)) { + if (!ObservesTypeOfEntry(aEntry)) { return; } mQueuedEntries.AppendElement(aEntry); } +/* + * Keep this list in alphabetical order. + * https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute + */ static const char16_t *const sValidTypeNames[4] = { u"mark", u"measure", - u"resource", - u"server" + u"navigation", + u"resource" }; void -PerformanceObserver::Observe(const PerformanceObserverInit& aOptions, - ErrorResult& aRv) -{ - if (aOptions.mEntryTypes.IsEmpty()) { - aRv.Throw(NS_ERROR_DOM_TYPE_ERR); +PerformanceObserver::ReportUnsupportedTypesErrorToConsole( + bool aIsMainThread, const char* msgId, const nsString& aInvalidTypes) { + if (!aIsMainThread) { + nsTArray params; + params.AppendElement(aInvalidTypes); + WorkerPrivate::ReportErrorToConsole(msgId, params); + } else { + nsCOMPtr ownerWindow = do_QueryInterface(mOwner); + nsIDocument* document = ownerWindow->GetExtantDoc(); + const char16_t* params[] = {aInvalidTypes.get()}; + nsContentUtils::ReportToConsole( + nsIScriptError::warningFlag, NS_LITERAL_CSTRING("DOM"), document, + nsContentUtils::eDOM_PROPERTIES, msgId, params, 1); + } + return; +} + +void PerformanceObserver::Observe(const PerformanceObserverInit& aOptions, + ErrorResult& aRv) { + const Optional>& maybeEntryTypes = aOptions.mEntryTypes; + const Optional& maybeType = aOptions.mType; + const Optional& maybeBuffered = aOptions.mBuffered; + + if (!mPerformance) { + aRv.Throw(NS_ERROR_FAILURE); return; } - nsTArray validEntryTypes; + if (!maybeEntryTypes.WasPassed() && !maybeType.WasPassed()) { + /* Per spec (3.3.1.2), this should be a syntax error. */ + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); + return; + } - for (const char16_t* name : sValidTypeNames) { - nsDependentString validTypeName(name); - if (aOptions.mEntryTypes.Contains(validTypeName) && - !validEntryTypes.Contains(validTypeName)) { - validEntryTypes.AppendElement(validTypeName); + if (maybeEntryTypes.WasPassed() && + (maybeType.WasPassed() || maybeBuffered.WasPassed())) { + /* Per spec (3.3.1.3), this, too, should be a syntax error. */ + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); + return; + } + + /* 3.3.1.4.1 */ + if (mObserverType == ObserverTypeUndefined) { + if (maybeEntryTypes.WasPassed()) { + mObserverType = ObserverTypeMultiple; + } else { + mObserverType = ObserverTypeSingle; } } - if (validEntryTypes.IsEmpty()) { - aRv.Throw(NS_ERROR_DOM_TYPE_ERR); + /* 3.3.1.4.2 */ + if (mObserverType == ObserverTypeSingle && maybeEntryTypes.WasPassed()) { + aRv.Throw(NS_ERROR_DOM_INVALID_MODIFICATION_ERR); + return; + } + /* 3.3.1.4.3 */ + if (mObserverType == ObserverTypeMultiple && maybeType.WasPassed()) { + aRv.Throw(NS_ERROR_DOM_INVALID_MODIFICATION_ERR); return; } - mEntryTypes.SwapElements(validEntryTypes); + /* 3.3.1.5 */ + if (mObserverType == ObserverTypeMultiple) { + const Sequence& entryTypes = maybeEntryTypes.Value(); - mPerformance->AddObserver(this); + if (entryTypes.IsEmpty()) { + return; + } - if (aOptions.mBuffered) { - for (auto entryType : mEntryTypes) { + /* 3.3.1.5.2 */ + nsTArray validEntryTypes; + for (const char16_t* name : sValidTypeNames) { + nsDependentString validTypeName(name); + if (entryTypes.Contains(validTypeName) && + !validEntryTypes.Contains(validTypeName)) { + validEntryTypes.AppendElement(validTypeName); + } + } + + nsAutoString invalidTypesJoined; + bool addComma = false; + for (const auto& type : entryTypes) { + if (!validEntryTypes.Contains(type)) { + if (addComma) { + invalidTypesJoined.AppendLiteral(", "); + } + addComma = true; + invalidTypesJoined.Append(type); + } + } + + if (!invalidTypesJoined.IsEmpty()) { + ReportUnsupportedTypesErrorToConsole(NS_IsMainThread(), + UnsupportedEntryTypesIgnoredMsgId, + invalidTypesJoined); + } + + /* 3.3.1.5.3 */ + if (validEntryTypes.IsEmpty()) { + nsString errorString; + ReportUnsupportedTypesErrorToConsole( + NS_IsMainThread(), AllEntryTypesIgnoredMsgId, errorString); + return; + } + + /* + * Registered or not, we clear out the list of options, and start fresh + * with the one that we are using here. (3.3.1.5.4,5) + */ + mOptions.Clear(); + mOptions.AppendElement(aOptions); + + } else { + MOZ_ASSERT(mObserverType == ObserverTypeSingle); + bool typeValid = false; + nsString type = maybeType.Value(); + + /* 3.3.1.6.2 */ + for (const char16_t* name : sValidTypeNames) { + nsDependentString validTypeName(name); + if (type == validTypeName) { + typeValid = true; + break; + } + } + + if (!typeValid) { + ReportUnsupportedTypesErrorToConsole( + NS_IsMainThread(), UnsupportedEntryTypesIgnoredMsgId, type); + return; + } + + /* 3.3.1.6.4, 3.3.1.6.4 */ + bool didUpdateOptionsList = false; + nsTArray updatedOptionsList; + for (auto& option : mOptions) { + if (option.mType.WasPassed() && option.mType.Value() == type) { + updatedOptionsList.AppendElement(aOptions); + didUpdateOptionsList = true; + } else { + updatedOptionsList.AppendElement(option); + } + } + if (!didUpdateOptionsList) { + updatedOptionsList.AppendElement(aOptions); + } + mOptions.SwapElements(updatedOptionsList); + + /* 3.3.1.6.5 */ + if (maybeBuffered.WasPassed() && maybeBuffered.Value()) { nsTArray> existingEntries; - mPerformance->GetEntriesByType(entryType, existingEntries); + mPerformance->GetEntriesByType(type, existingEntries); if (!existingEntries.IsEmpty()) { mQueuedEntries.AppendElements(existingEntries); } } } - + /* Add ourselves to the list of registered performance + * observers, if necessary. (3.3.1.5.4,5; 3.3.1.6.4) + */ + mPerformance->AddObserver(this); mConnected = true; } +void +PerformanceObserver::GetSupportedEntryTypes(const GlobalObject& aGlobal, JS::MutableHandle aObject) +{ + nsTArray validTypes; + JS::Rooted val(aGlobal.Context()); + + for (const char16_t* name : sValidTypeNames) { + nsString validTypeName(name); + validTypes.AppendElement(validTypeName); + } + + if (!ToJSValue(aGlobal.Context(), validTypes, &val)) { + /* + * If this conversion fails, we don't set a result. + * The spec does not allow us to throw an exception. + */ + return; + } + aObject.set(&val.toObject()); +} + +bool +PerformanceObserver::ObservesTypeOfEntry(PerformanceEntry* aEntry) +{ + for (auto& option : mOptions) { + if (option.mType.WasPassed()) { + if (option.mType.Value() == aEntry->GetEntryType()) { + return true; + } + } else { + if (option.mEntryTypes.Value().Contains(aEntry->GetEntryType())) { + return true; + } + } + } + return false; +} + void PerformanceObserver::Disconnect() { @@ -192,3 +365,10 @@ PerformanceObserver::Disconnect() mConnected = false; } } + +void +PerformanceObserver::TakeRecords(nsTArray>& aRetval) +{ + MOZ_ASSERT(aRetval.IsEmpty()); + aRetval.SwapElements(mQueuedEntries); +} diff --git a/dom/performance/PerformanceObserver.h b/dom/performance/PerformanceObserver.h index 283000d581..25d5f98f6a 100644 --- a/dom/performance/PerformanceObserver.h +++ b/dom/performance/PerformanceObserver.h @@ -55,19 +55,37 @@ public: void Observe(const PerformanceObserverInit& aOptions, mozilla::ErrorResult& aRv); + static void GetSupportedEntryTypes(const GlobalObject& aGlobal, + JS::MutableHandle aObject); void Disconnect(); + void TakeRecords(nsTArray>& aRetval); + void Notify(); void QueueEntry(PerformanceEntry* aEntry); + bool ObservesTypeOfEntry(PerformanceEntry* aEntry); + private: + void ReportUnsupportedTypesErrorToConsole(bool aIsMainThread, + const char* msgId, + const nsString& aInvalidTypes); ~PerformanceObserver(); nsCOMPtr mOwner; RefPtr mCallback; RefPtr mPerformance; nsTArray mEntryTypes; + nsTArray mOptions; + enum { + ObserverTypeUndefined, + ObserverTypeSingle, + ObserverTypeMultiple, + } mObserverType; + /* + * This is also known as registered, in the spec. + */ bool mConnected; nsTArray> mQueuedEntries; }; diff --git a/dom/performance/tests/test_performance_observer.js b/dom/performance/tests/test_performance_observer.js index 9716570e29..767240a99b 100644 --- a/dom/performance/tests/test_performance_observer.js +++ b/dom/performance/tests/test_performance_observer.js @@ -14,25 +14,25 @@ test(t => { var observer = new PerformanceObserver(() => { }); - assert_throws({name: "TypeError"}, function() { + assert_throws({name: "SyntaxError"}, function() { observer.observe(); - }, "observe() should throw TypeError exception if no option specified."); + }, "observe() should throw SyntaxError exception if no option specified."); - assert_throws({name: "TypeError"}, function() { + assert_throws({name: "SyntaxError"}, function() { observer.observe({ unsupportedAttribute: "unsupported" }); - }, "obsrve() should throw TypeError exception if the option has no 'entryTypes' attribute."); + }, "observe() should throw SyntaxError exception if the option has no 'entryTypes' attribute."); assert_throws({name: "TypeError"}, function() { observer.observe({ entryTypes: [] }); - }, "obsrve() should throw TypeError exception if 'entryTypes' attribute is an empty sequence."); + }, "observe() should throw TypeError exception if 'entryTypes' attribute is an empty sequence."); assert_throws({name: "TypeError"}, function() { observer.observe({ entryTypes: null }); - }, "obsrve() should throw TypeError exception if 'entryTypes' attribute is null."); + }, "observe() should throw TypeError exception if 'entryTypes' attribute is null."); assert_throws({name: "TypeError"}, function() { observer.observe({ entryTypes: ["invalid"]}); - }, "obsrve() should throw TypeError exception if 'entryTypes' attribute value is invalid."); + }, "observe() should throw TypeError exception if 'entryTypes' attribute value is invalid."); }, "Test that PerformanceObserver.observe throws exception"); function promiseObserve(test, options) { diff --git a/dom/webidl/PerformanceObserver.webidl b/dom/webidl/PerformanceObserver.webidl index 4cebecbeba..4e08adb34b 100644 --- a/dom/webidl/PerformanceObserver.webidl +++ b/dom/webidl/PerformanceObserver.webidl @@ -8,8 +8,9 @@ */ dictionary PerformanceObserverInit { - required sequence entryTypes; - boolean buffered = false; + sequence entryTypes; + DOMString type; + boolean buffered; }; callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer); @@ -18,7 +19,8 @@ callback PerformanceObserverCallback = void (PerformanceObserverEntryList entrie Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)] interface PerformanceObserver { - [Throws] - void observe(PerformanceObserverInit options); + [Throws] void observe(optional PerformanceObserverInit options); void disconnect(); + PerformanceEntryList takeRecords(); + static readonly attribute object supportedEntryTypes; }; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index a7a4929f3b..2f2fa78d42 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1000,11 +1000,13 @@ private: class ReportErrorToConsoleRunnable final : public WorkerRunnable { const char* mMessage; + const nsTArray mParams; public: // aWorkerPrivate is the worker thread we're on (or the main thread, if null) static void - Report(WorkerPrivate* aWorkerPrivate, const char* aMessage) + Report(WorkerPrivate* aWorkerPrivate, const char* aMessage, + const nsTArray& aParams) { if (aWorkerPrivate) { aWorkerPrivate->AssertIsOnWorkerThread(); @@ -1015,23 +1017,30 @@ public: // Now fire a runnable to do the same on the parent's thread if we can. if (aWorkerPrivate) { RefPtr runnable = - new ReportErrorToConsoleRunnable(aWorkerPrivate, aMessage); + new ReportErrorToConsoleRunnable(aWorkerPrivate, aMessage, aParams); runnable->Dispatch(); return; } + uint16_t paramCount = aParams.Length(); + const char16_t** params = new const char16_t*[paramCount]; + for (uint16_t i=0; i& aParams) : WorkerRunnable(aWorkerPrivate, ParentThreadUnchangedBusyCount), - mMessage(aMessage) + mMessage(aMessage), mParams(aParams) { } virtual void @@ -1048,7 +1057,7 @@ private: { WorkerPrivate* parent = aWorkerPrivate->GetParent(); MOZ_ASSERT_IF(!parent, NS_IsMainThread()); - Report(parent, mMessage); + Report(parent, mMessage, mParams); return true; } }; @@ -6022,13 +6031,22 @@ WorkerPrivate::ReportError(JSContext* aCx, JS::ConstUTF8CharsZ aToStringResult, // static void WorkerPrivate::ReportErrorToConsole(const char* aMessage) +{ + nsTArray emptyParams; + WorkerPrivate::ReportErrorToConsole(aMessage, emptyParams); +} + +// static +void +WorkerPrivate::ReportErrorToConsole(const char* aMessage, + const nsTArray& aParams) { WorkerPrivate* wp = nullptr; if (!NS_IsMainThread()) { wp = GetCurrentThreadWorkerPrivate(); } - ReportErrorToConsoleRunnable::Report(wp, aMessage); + ReportErrorToConsoleRunnable::Report(wp, aMessage, aParams); } int32_t diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index 0a71420047..351f5458f1 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -1206,6 +1206,9 @@ public: static void ReportErrorToConsole(const char* aMessage); + static void + ReportErrorToConsole(const char* aMessage, const nsTArray& aParams); + int32_t SetTimeout(JSContext* aCx, nsIScriptTimeoutHandler* aHandler, int32_t aTimeout, bool aIsInterval, From 6464b061c349d47a24c294b455d59d594851e95a Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 6 Aug 2023 22:28:22 -0500 Subject: [PATCH 02/10] Issue #2026 - Follow-up: Support Big(U)Int64Array in crypto.getRandomValues. https://bugzilla.mozilla.org/show_bug.cgi?id=1718932 --- dom/base/Crypto.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index 4226832f4b..863c26c902 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -75,6 +75,8 @@ Crypto::GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray, case js::Scalar::Uint16: case js::Scalar::Int32: case js::Scalar::Uint32: + case js::Scalar::BigInt64: + case js::Scalar::BigUint64: break; default: aRv.Throw(NS_ERROR_DOM_TYPE_MISMATCH_ERR); From 42b2de6fe9082a9a3821423dd871c0646ae32cfe Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 6 Aug 2023 22:35:51 -0500 Subject: [PATCH 03/10] Issue #2285 - Ensure we don't try to treat non-DOM-Node event targets as such, https://bugzilla.mozilla.org/show_bug.cgi?id=1440809 Fix crash on https://beeper.notion.site --- dom/base/FragmentOrElement.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 6aea6820ef..354e92193b 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1026,7 +1026,12 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor) nsContentUtils::Retarget(relatedTargetAsNode, this); nsCOMPtr targetInKnownToBeHandledScope = FindChromeAccessOnlySubtreeOwner(aVisitor.mTargetInKnownToBeHandledScope); - if (nsContentUtils::ContentIsShadowIncludingDescendantOf( + // If aVisitor.mTargetInKnownToBeHandledScope wasn't nsINode, + // targetInKnownToBeHandledScope will be null. This may happen when + // dispatching event to Window object in a content page and + // propagating the event to a chrome Element. + if (targetInKnownToBeHandledScope && + nsContentUtils::ContentIsShadowIncludingDescendantOf( this, targetInKnownToBeHandledScope->SubtreeRoot())) { // Part of step 11.4. // "If target's root is a shadow-including inclusive ancestor of From 0e1816aa4c0b2fedf2b33e8b5922715465ed7696 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 6 Aug 2023 23:22:09 -0500 Subject: [PATCH 04/10] No Issue - Fix building with --enable-js-lto Needed to include jscntxt.h due to de-unified building. --- js/src/builtin/intl/CommonFunctions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/builtin/intl/CommonFunctions.h b/js/src/builtin/intl/CommonFunctions.h index 66312ebc69..de97bd4084 100644 --- a/js/src/builtin/intl/CommonFunctions.h +++ b/js/src/builtin/intl/CommonFunctions.h @@ -18,6 +18,8 @@ #include "js/Vector.h" #include "vm/String.h" +#include "jscntxt.h" + namespace JS { class Value; } class JSObject; @@ -159,4 +161,4 @@ CallICU(JSContext* cx, const ICUStringFunction& strFn) } // namespace js -#endif /* builtin_intl_CommonFunctions_h */ \ No newline at end of file +#endif /* builtin_intl_CommonFunctions_h */ From 4bbb81d78ee2f0c6342955cb0b2392a684721653 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 15 Jul 2023 16:03:23 +0200 Subject: [PATCH 05/10] [Pale-Moon] [SSUAO] Update Chase override --- application/palemoon/branding/shared/pref/uaoverrides.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index 156d17fcb1..b6d1938a8c 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -59,7 +59,7 @@ pref("@GUAO_PREF@.zoho.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); pref("@GUAO_PREF@.privat24.ua","Mozilla/5.0 (%OS_SLICE% rv:38.0) @GK_SLICE@ Firefox/38.0"); pref("@GUAO_PREF@.citi.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0 SeaMonkey/2.53.12"); -pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:112.0) @GK_SLICE@ Firefox/112.0"); +pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:102.0) @GK_SLICE@ Firefox/102.0"); pref("@GUAO_PREF@.facebook.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0 @PM_SLICE@"); pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9"); pref("@GUAO_PREF@.netflximg.net","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9"); From ca3e82a227cb2cc4e56770f3656bbcce4d9454ad Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Fri, 4 Aug 2023 21:06:04 -0400 Subject: [PATCH 06/10] [Pale-Moon] [SSUAO] Add dictionary.cambridge.org override --- application/palemoon/branding/shared/pref/uaoverrides.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index b6d1938a8c..1ff48f9e79 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -71,6 +71,7 @@ pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLI pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @GRE_VERSION_SLICE@ @FX_SLICE@ @PM_SLICE@"); // The following domains do not like the Goanna slice +pref("@GUAO_PREF@.dictionary.cambridge.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @PM_SLICE@"); From fafbea8f153964661be26eb5771d08ad34d70c98 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Sun, 6 Aug 2023 21:22:54 -0400 Subject: [PATCH 07/10] [Pale-Moon] [SSUAO] Fix several dictionaries to not include the Goanna slice. --- application/palemoon/branding/shared/pref/uaoverrides.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index 1ff48f9e79..6cedfbe137 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -71,8 +71,12 @@ pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLI pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @GRE_VERSION_SLICE@ @FX_SLICE@ @PM_SLICE@"); // The following domains do not like the Goanna slice +pref("@GUAO_PREF@.bab.la","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.babla.gr","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.collinsdictionary.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.dictionary.cambridge.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.ldoceonline.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @PM_SLICE@"); // ============================================================================ From 85a5c5821499012f92331b97d5ac2b40b5653794 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Fri, 4 Aug 2023 21:14:40 -0400 Subject: [PATCH 08/10] [Basilisk] [SSUAO] Update chase.com override --- application/basilisk/branding/shared/uaoverrides.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 5e01a8f9f0..91100c92cc 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -22,7 +22,7 @@ pref("@GUAO_PREF@.addons.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) // Required for domains that are unresponsive to requests from users (or likely to be) pref("@GUAO_PREF@.aol.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); pref("@GUAO_PREF@.bing.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); -pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:79.0) @GK_SLICE@ Firefox/79.0"); +pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:102.0) @GK_SLICE@ Firefox/102.0"); pref("@GUAO_PREF@.dropbox.com","Mozilla/5.0 (%OS_SLICE% rv:68.9) @GK_SLICE@ Firefox/68.9 (Basilisk)"); pref("@GUAO_PREF@.instagram.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0"); pref("@GUAO_PREF@.google.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0 @APP_SLICE@"); From 4a98d682de2fd9b245a8e1f705f61e054de94a55 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Fri, 4 Aug 2023 21:06:04 -0400 Subject: [PATCH 09/10] [Basilisk] [SSUAO] Add dictionary.cambridge.org override --- application/basilisk/branding/shared/uaoverrides.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 91100c92cc..90b9749f12 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -76,6 +76,7 @@ pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLIC pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0"); // The following domains do not like the Goanna slice +pref("@GUAO_PREF@.dictionary.cambridge.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@"); From b27c5cf236051840e48c6ec438c296c696c9d896 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Sun, 6 Aug 2023 21:21:27 -0400 Subject: [PATCH 10/10] [Basilisk] [SSUAO] Dictionaries really do not like the Goanna slice... Reported by VistaLover on MSFN --- application/basilisk/branding/shared/uaoverrides.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 90b9749f12..cffa9d1318 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -76,8 +76,12 @@ pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLIC pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0"); // The following domains do not like the Goanna slice +pref("@GUAO_PREF@.bab.la","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.babla.gr","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.collinsdictionary.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.dictionary.cambridge.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.ldoceonline.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@"); // Domains Basilisk overrides that are not in the Pale Moon overrides