From 642b60fdffa2d3e734d1191af710163dd0ba11c9 Mon Sep 17 00:00:00 2001 From: Fellyph Cintra Date: Sat, 17 Feb 2024 11:45:49 +0000 Subject: [PATCH 1/3] adding sandbox property --- src/demos/storage-access-api/index.ejs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/demos/storage-access-api/index.ejs b/src/demos/storage-access-api/index.ejs index 5604b62..5946816 100644 --- a/src/demos/storage-access-api/index.ejs +++ b/src/demos/storage-access-api/index.ejs @@ -1,5 +1,9 @@ <%- include(commonPath + '/header.ejs') %> <%- include(commonPath + '/internal-page/header.ejs') %> - + <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> From a664737033efd276a0940a4bddc2accfa65e71f4 Mon Sep 17 00:00:00 2001 From: Fellyph Cintra Date: Sat, 17 Feb 2024 11:46:08 +0000 Subject: [PATCH 2/3] removing console --- src/demos/storage-access-api/personalization.ejs | 11 ++--------- src/scenarios/personalization/personalization.ejs | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/demos/storage-access-api/personalization.ejs b/src/demos/storage-access-api/personalization.ejs index 91f9c0a..340ddb4 100644 --- a/src/demos/storage-access-api/personalization.ejs +++ b/src/demos/storage-access-api/personalization.ejs @@ -17,7 +17,6 @@ document.addEventListener('DOMContentLoaded', () => { }) async function updateUserPreference() { - console.log('hasStorageAccess', hasStorageAccess); if ( hasStorageAccess ) { fetchAndApplyTheme(); } else { @@ -27,8 +26,7 @@ document.addEventListener('DOMContentLoaded', () => { loadButton.classList.add('hidden'); fetchAndApplyTheme(); } catch (error) { - console.error('There has been a problem with your fetch operation:', error); - errorMessages.textContent = `Error: ${error}`; + errorMessages.textContent = error?.message; } } } @@ -48,14 +46,12 @@ document.addEventListener('DOMContentLoaded', () => { .then(data => { const theme = data.theme; pageContainer.className = `${containerClass} ${data.theme}` - console.log('theme', theme); if (theme === 'dark') { themeSwitcher.checked = true; } }) .catch(error => { - console.error('There has been a problem with your fetch operation:', error); - errorMessages.textContent = `Error: ${error.message}`; + errorMessages.textContent = error?.message; }); } @@ -83,11 +79,9 @@ document.addEventListener('DOMContentLoaded', () => { if ( await document.hasStorageAccess() ) { fetchSetPersonalization(); } else { - console.error('User denied storage access'); errorMessages.textContent = 'User denied storage access'; } } catch (error) { - console.error('Error:', error); errorMessages.textContent = `The request to storage access API was denied because the user never interacted with the top-level site context or the permission wasn't grant by the user`; } } @@ -95,7 +89,6 @@ document.addEventListener('DOMContentLoaded', () => { window.toggleTheme = toggleTheme; if (isIframe && !hasStorageAccess) { - console.log('In iframe'); toggleContainer.classList.add('hidden'); loadButton.classList.remove('hidden'); loadButton.addEventListener('click', updateUserPreference); diff --git a/src/scenarios/personalization/personalization.ejs b/src/scenarios/personalization/personalization.ejs index df30077..3247e06 100644 --- a/src/scenarios/personalization/personalization.ejs +++ b/src/scenarios/personalization/personalization.ejs @@ -23,7 +23,6 @@ document.addEventListener('DOMContentLoaded', () => { } }) .catch(error => { - console.error('There has been a problem with your fetch operation:', error); statusMessage.textContent = `There was an error fetching your personalization settings: ${error.message}`; }); } @@ -44,7 +43,6 @@ document.addEventListener('DOMContentLoaded', () => { .then(data => { pageContainer.className = data.theme; }).catch(error => { - console.error('There has been a problem with your fetch operation:', error); statusMessage.textContent = `There was an error updating your personalization settings: ${error.message}`; }); } From 26b63105068894bd9d209e27bb97b71bd6488eb9 Mon Sep 17 00:00:00 2001 From: Fellyph Cintra Date: Mon, 19 Feb 2024 17:09:27 +0000 Subject: [PATCH 3/3] changing Title on shopping cart page --- src/scenarios/ecommerce/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scenarios/ecommerce/routes.js b/src/scenarios/ecommerce/routes.js index d725f52..2ee10a5 100644 --- a/src/scenarios/ecommerce/routes.js +++ b/src/scenarios/ecommerce/routes.js @@ -6,7 +6,7 @@ const router = express.Router(); // Middleware to setup common rendering variables router.use((req, res, next) => { // Set common variables for rendering views - res.locals.title = 'E-Commerce - Privacy Sandbox' // Set the page title + res.locals.title = 'Shopping Cart' // Set the page title next(); // Continue to the next middleware or route handler });