Move sw-tips tutorial to use chrome.dev (#1505)

Moves from the Glitch URL to chrome.dev, and removes the host
permissions as we now set CORS headers.
This commit is contained in:
Oliver Dunk
2025-07-10 14:31:51 +01:00
committed by GitHub
parent b55612ae64
commit 517cf1093e
2 changed files with 1 additions and 2 deletions

View File

@@ -16,7 +16,6 @@
"keyword": "api"
},
"permissions": ["alarms", "storage"],
"host_permissions": ["https://extension-tips.glitch.me/*"],
"content_scripts": [
{
"matches": ["https://developer.chrome.com/docs/extensions/reference/*"],

View File

@@ -2,7 +2,7 @@ console.log('sw-tips.js');
// Fetch tip & save in storage
const updateTip = async () => {
const response = await fetch('https://extension-tips.glitch.me/tips.json');
const response = await fetch('https://chrome.dev/f/extension_tips/');
const tips = await response.json();
const randomIndex = Math.floor(Math.random() * tips.length);
return chrome.storage.local.set({ tip: tips[randomIndex] });