mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
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:
@@ -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/*"],
|
||||
|
||||
@@ -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] });
|
||||
|
||||
Reference in New Issue
Block a user