From a22fee14b531c820e404cf08db03b5f390468553 Mon Sep 17 00:00:00 2001 From: rvanasa Date: Thu, 7 Sep 2023 14:12:09 -0600 Subject: [PATCH] Keep track of 'document.referrer' and 'window.opener' --- service/pool/Main.mo | 2 +- src/build.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/service/pool/Main.mo b/service/pool/Main.mo index c282a205..7bce335f 100644 --- a/service/pool/Main.mo +++ b/service/pool/Main.mo @@ -135,7 +135,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this { await getExpiredCanisterInfo(origin); }; - type InstallConfig = { profiling: Bool; is_whitelisted: Bool; origin: Text }; + type InstallConfig = { profiling: Bool; is_whitelisted: Bool; origin: Text; referrer: ?Text }; public shared ({ caller }) func installCode(info : Types.CanisterInfo, args : Types.InstallArgs, install_config : InstallConfig) : async Types.CanisterInfo { if (install_config.origin == "") { throw Error.reject "Please specify an origin"; diff --git a/src/build.ts b/src/build.ts index b88caff2..7447aee9 100644 --- a/src/build.ts +++ b/src/build.ts @@ -196,6 +196,7 @@ async function install( profiling, is_whitelisted: false, origin, + referrer: document.referrer || (window.opener && "(opener)") || undefined, }; const new_info = await backend.installCode( canisterInfo,