[feedback] text-tools: Unchecked runtime.lastError: Cannot create item with duplicate id text #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feedback #35 · 2026-11-19 16:39:17 · ext:
text-tools· reason:bugsOrigen: https://greasysprocket.com/feedback · repo destino:
extensiónCreado por el triaje automático (
gs-feedback-triage.py).Diagnóstico
setupContextMenus()está enganchado aonInstalledy aonStartupsin guard de reentrada: si ambos disparan solapados, elremoveAllde la segunda cadena borra los ids que la primera acaba de crear, y elcreate({id: "text-tools-parent"})posterior choca con el de la otra cadena. Como el callback no leechrome.runtime.lastError, Chrome lo reporta comoUnchecked runtime.lastError: Cannot create item with duplicate id.Ficheros
src/entrypoints/background.ts:16—PARENT_ID = "text-tools-parent"src/entrypoints/background.ts:38-56—removeAll+createsin comprobarlastErrorsrc/entrypoints/background.ts:58(onInstalled) y:81(onStartup) — dos disparadores del mismo setupPlan (bug)
menuCreating/menuPendingcon bucledo…whilealrededor del setup, como encopycat/src/entrypoints/background.ts:35-105.createMenu()que en el callback leachrome.runtime.lastErrory trateduplicate idcomo no-op (browser.contextMenus.createdel polyfill no lanza: deja el error ahí y se ve como "Unchecked").tests/con un fake dechrome.contextMenusque llame al setup dos veces seguidas y exija 0 errores.