From 96f518df9418648f0a976906ccab248b97d03f64 Mon Sep 17 00:00:00 2001 From: Nate Chapin Date: Thu, 18 Nov 2021 16:31:58 -0800 Subject: [PATCH] Allow appHistory entries that are cross-site-instance, forbid ones that are noreferrer This follows https://github.com/WICG/app-history/issues/71 Change-Id: I07e7ff1376dd9eca34b4493a06a658f1b72da027 --- .../app-history-entry/entry-after-detach.html | 4 +-- .../no-referrer-dynamic-url-censored.html | 33 +++++++++++++++++++ .../no-referrer-from-meta-url-censored.html | 32 ++++++++++++++++++ .../no-referrer-url-censored.html | 32 ++++++++++++++++++ .../resources/no-referrer-meta.html | 2 ++ .../resources/no-referrer.html | 1 + .../resources/no-referrer.html.headers | 1 + 7 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 app-history/app-history-entry/no-referrer-dynamic-url-censored.html create mode 100644 app-history/app-history-entry/no-referrer-from-meta-url-censored.html create mode 100644 app-history/app-history-entry/no-referrer-url-censored.html create mode 100644 app-history/app-history-entry/resources/no-referrer-meta.html create mode 100644 app-history/app-history-entry/resources/no-referrer.html create mode 100644 app-history/app-history-entry/resources/no-referrer.html.headers diff --git a/app-history/app-history-entry/entry-after-detach.html b/app-history/app-history-entry/entry-after-detach.html index 9d99918c5b263c3..dc31f1a695b013f 100644 --- a/app-history/app-history-entry/entry-after-detach.html +++ b/app-history/app-history-entry/entry-after-detach.html @@ -7,12 +7,12 @@ window.onload = t.step_func_done(() => { let i_entry = i.contentWindow.appHistory.current; assert_true(i_entry.sameDocument); - assert_not_equals(i_entry.url, ""); + assert_not_equals(i_entry.url, null); assert_not_equals(i_entry.key, ""); assert_not_equals(i_entry.id, ""); i.remove(); assert_false(i_entry.sameDocument); - assert_equals(i_entry.url, ""); + assert_equals(i_entry.url, null); assert_equals(i_entry.key, ""); assert_equals(i_entry.id, ""); }); diff --git a/app-history/app-history-entry/no-referrer-dynamic-url-censored.html b/app-history/app-history-entry/no-referrer-dynamic-url-censored.html new file mode 100644 index 000000000000000..cacbc2c180695b7 --- /dev/null +++ b/app-history/app-history-entry/no-referrer-dynamic-url-censored.html @@ -0,0 +1,33 @@ + + + + + diff --git a/app-history/app-history-entry/no-referrer-from-meta-url-censored.html b/app-history/app-history-entry/no-referrer-from-meta-url-censored.html new file mode 100644 index 000000000000000..0f23f3b539b0641 --- /dev/null +++ b/app-history/app-history-entry/no-referrer-from-meta-url-censored.html @@ -0,0 +1,32 @@ + + + + + diff --git a/app-history/app-history-entry/no-referrer-url-censored.html b/app-history/app-history-entry/no-referrer-url-censored.html new file mode 100644 index 000000000000000..2db425368f6a043 --- /dev/null +++ b/app-history/app-history-entry/no-referrer-url-censored.html @@ -0,0 +1,32 @@ + + + + + diff --git a/app-history/app-history-entry/resources/no-referrer-meta.html b/app-history/app-history-entry/resources/no-referrer-meta.html new file mode 100644 index 000000000000000..bd5ec391cce8921 --- /dev/null +++ b/app-history/app-history-entry/resources/no-referrer-meta.html @@ -0,0 +1,2 @@ + + diff --git a/app-history/app-history-entry/resources/no-referrer.html b/app-history/app-history-entry/resources/no-referrer.html new file mode 100644 index 000000000000000..c8b7661f4221298 --- /dev/null +++ b/app-history/app-history-entry/resources/no-referrer.html @@ -0,0 +1 @@ + diff --git a/app-history/app-history-entry/resources/no-referrer.html.headers b/app-history/app-history-entry/resources/no-referrer.html.headers new file mode 100644 index 000000000000000..7ffbf17d6be5a59 --- /dev/null +++ b/app-history/app-history-entry/resources/no-referrer.html.headers @@ -0,0 +1 @@ +Referrer-Policy: no-referrer