mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
ecd3cd8676
53 changed files with 67 additions and 1452 deletions
|
|
@ -632,22 +632,10 @@ Navigator::GetBuildID(nsAString& aBuildID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
Navigator::GetDoNotTrack(nsAString &aResult)
|
||||
bool
|
||||
Navigator::GlobalPrivacyControl()
|
||||
{
|
||||
bool doNotTrack = nsContentUtils::DoNotTrackEnabled();
|
||||
if (!doNotTrack) {
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(mWindow);
|
||||
doNotTrack = loadContext && loadContext->UseTrackingProtection();
|
||||
}
|
||||
|
||||
if (doNotTrack) {
|
||||
aResult.AssignLiteral("1");
|
||||
} else {
|
||||
aResult.AssignLiteral("unspecified");
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return nsContentUtils::GPCEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public:
|
|||
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
|
||||
nsPluginArray* GetPlugins(ErrorResult& aRv);
|
||||
Permissions* GetPermissions(ErrorResult& aRv);
|
||||
// The XPCOM GetDoNotTrack is ok
|
||||
bool GlobalPrivacyControl();
|
||||
Geolocation* GetGeolocation(ErrorResult& aRv);
|
||||
|
||||
static void AppName(nsAString& aAppName, bool aUsePrefOverriddenValue);
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ bool nsContentUtils::sFragmentParsingActive = false;
|
|||
bool nsContentUtils::sDOMWindowDumpEnabled;
|
||||
#endif
|
||||
|
||||
bool nsContentUtils::sDoNotTrackEnabled = false;
|
||||
bool nsContentUtils::sGPCEnabled = false;
|
||||
|
||||
mozilla::LazyLogModule nsContentUtils::sDOMDumpLog("Dump");
|
||||
|
||||
|
|
@ -626,8 +626,8 @@ nsContentUtils::Init()
|
|||
"browser.dom.window.dump.enabled");
|
||||
#endif
|
||||
|
||||
Preferences::AddBoolVarCache(&sDoNotTrackEnabled,
|
||||
"privacy.donottrackheader.enabled", false);
|
||||
Preferences::AddBoolVarCache(&sGPCEnabled,
|
||||
"privacy.GPCheader.enabled", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sUseActivityCursor,
|
||||
"ui.use_activity_cursor", false);
|
||||
|
|
@ -7337,9 +7337,9 @@ nsContentUtils::DOMWindowDumpEnabled()
|
|||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::DoNotTrackEnabled()
|
||||
nsContentUtils::GPCEnabled()
|
||||
{
|
||||
return nsContentUtils::sDoNotTrackEnabled;
|
||||
return nsContentUtils::sGPCEnabled;
|
||||
}
|
||||
|
||||
mozilla::LogModule*
|
||||
|
|
|
|||
|
|
@ -2432,9 +2432,9 @@ public:
|
|||
static bool DOMWindowDumpEnabled();
|
||||
|
||||
/**
|
||||
* Returns true if the privacy.donottrackheader.enabled pref is set.
|
||||
* Returns true if the privacy.GPCheader.enabled pref is set.
|
||||
*/
|
||||
static bool DoNotTrackEnabled();
|
||||
static bool GPCEnabled();
|
||||
|
||||
/**
|
||||
* Returns a LogModule that dump calls from content script are logged to.
|
||||
|
|
@ -2971,7 +2971,7 @@ private:
|
|||
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
|
||||
static bool sDOMWindowDumpEnabled;
|
||||
#endif
|
||||
static bool sDoNotTrackEnabled;
|
||||
static bool sGPCEnabled;
|
||||
static mozilla::LazyLogModule sDOMDumpLog;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,5 +22,4 @@ interface nsIDOMNavigator : nsISupports
|
|||
readonly attribute DOMString productSub;
|
||||
readonly attribute DOMString userAgent;
|
||||
readonly attribute DOMString buildID;
|
||||
readonly attribute DOMString doNotTrack;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ Navigator implements NavigatorContentUtils;
|
|||
Navigator implements NavigatorStorageUtils;
|
||||
Navigator implements NavigatorConcurrentHardware;
|
||||
Navigator implements NavigatorStorage;
|
||||
Navigator implements NavigatorGlobalPrivacyControl;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorID {
|
||||
|
|
@ -111,9 +112,10 @@ partial interface Navigator {
|
|||
readonly attribute PluginArray plugins;
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/tracking-dnt/ sort of
|
||||
partial interface Navigator {
|
||||
readonly attribute DOMString doNotTrack;
|
||||
// https://globalprivacycontrol.github.io/gpc-spec/
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorGlobalPrivacyControl {
|
||||
readonly attribute boolean globalPrivacyControl;
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/geolocation-API/#geolocation_interface
|
||||
|
|
|
|||
|
|
@ -12,3 +12,4 @@ WorkerNavigator implements NavigatorLanguage;
|
|||
WorkerNavigator implements NavigatorOnLine;
|
||||
WorkerNavigator implements NavigatorConcurrentHardware;
|
||||
WorkerNavigator implements NavigatorStorage;
|
||||
WorkerNavigator implements NavigatorGlobalPrivacyControl;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "Workers.h"
|
||||
#include "RuntimeService.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/dom/StorageManager.h"
|
||||
|
|
@ -100,6 +101,11 @@ public:
|
|||
mOnline = aOnline;
|
||||
}
|
||||
|
||||
bool GlobalPrivacyControl() const
|
||||
{
|
||||
return nsContentUtils::GPCEnabled();
|
||||
}
|
||||
|
||||
void SetLanguages(const nsTArray<nsString>& aLanguages);
|
||||
|
||||
uint64_t HardwareConcurrency() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue