mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-26 13:19:49 +07:00
Add linter fixes for new AI samples (#1484)
This commit is contained in:
@@ -65,6 +65,7 @@ module.exports = [
|
||||
'_archive/**/*',
|
||||
'**/third-party/**',
|
||||
'**/node_modules/**/*',
|
||||
'**/dist/**/*',
|
||||
// These are autogenerated files that we shouldn't lint
|
||||
'functional-samples/cookbook.wasm-helloworld-print/wasm/pkg/**/*',
|
||||
'functional-samples/cookbook.wasm-helloworld-print-nomodule/wasm/pkg/**/*'
|
||||
|
||||
@@ -26,7 +26,7 @@ async function generateAltText(imgSrc) {
|
||||
return await session.prompt(prompt);
|
||||
}
|
||||
|
||||
chrome.contextMenus.onClicked.addListener(async (info, tab) => {
|
||||
chrome.contextMenus.onClicked.addListener(async (info, _tab) => {
|
||||
if (info.menuItemId === 'generateAltText' && info.srcUrl) {
|
||||
// Start opening the popup
|
||||
const [result] = await Promise.allSettled([
|
||||
|
||||
@@ -10,7 +10,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
async function renderMessages() {
|
||||
messageList.innerHTML = ''; // Clear existing messages
|
||||
let delay = 0; // Initial delay
|
||||
const delayIncrement = 3000; // 5 seconds in milliseconds
|
||||
|
||||
await timeout(3000);
|
||||
|
||||
@@ -67,11 +67,10 @@ chrome.runtime.onMessage.addListener(async ({ data }) => {
|
||||
});
|
||||
|
||||
function isValidUrl(string) {
|
||||
let url;
|
||||
|
||||
try {
|
||||
url = new URL(string);
|
||||
new URL(string);
|
||||
return true;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user