Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field chrome_url_overrides persists in browser profile even after removal #149

Open
ApacheAlpha opened this issue Aug 18, 2024 · 6 comments
Assignees
Labels
browser:all bug Something isn't working help wanted Extra attention is needed

Comments

@ApacheAlpha
Copy link

Implementation process

When I create a new project using the template command:

npx extension create test-extensions-tem --template=tailwind

I don't need a page to overlay the Google Chrome homepage,So I deleted the chrome_url_overrides configuration in the manifest.json file

Before deletion

{ "manifest_version": 3, "version": "1.0", "name": "test-extensions-tem", "description": "An extension template using Tailwind. This template includes a new tab override.", "icons": { "16": "public/icons/icon_16.png", "48": "public/icons/icon_48.png" }, "chrome_url_overrides": { "newtab": "newtab/index.html" } }

After deletion

{ "manifest_version": 3, "version": "1.0", "name": "test-extensions-tem", "description": "An extension template using Tailwind. This template includes a new tab override.", "icons": { "16": "public/icons/icon_16.png", "48": "public/icons/icon_48.png" } }
After deleting it, I restarted the entire project. When I opened a new tab, it prompted:

截图 2024-08-18 11-20-27

无法访问您的文件该文件可能已被移至别处、修改或删除。ERR_FILE_NOT_FOUND == Unable to access your file The file may have been moved, modified, or deleted. ERR_FILE_NOT_FOUND

Why can't I delete the chrome_url_overrides configuration? How can I solve this problem?

@cezaraugusto
Copy link
Member

hi @ApacheAlpha thanks for reporting!

it seems a cache thing. what happens when you reload the extension in the browser?

@cezaraugusto
Copy link
Member

@ApacheAlpha I did several updates to the project since the last message. Could you try again and let me know if it is still broken? Also, new template names in v2 https://extension.js.org/docs/getting-started/templates

@ApacheAlpha
Copy link
Author

ApacheAlpha commented Sep 13, 2024

@cezaraugusto

Thank you for your hard work on this framework.

Here is my testing process:

First I used the command:

npx extension create test-extensions-new-react --template=new-react

The results are shown in the figure
截图 2024-09-13 18-38-46

I opened the entire project using the Vscode editor and then executed
npm run dev

When I open a new browser tab, the entire interface is displayed normally

截图 2024-09-13 18-43-28

I stopped the whole project using Ctrl + C, then went into manifest.json and deleted Configuration

"chrome_url_overrides": {
"newtab": "newtab/index.html"
},

Then I started the project using the command: npm run dev and I found the first problem

Why is the browser homepage still overwritten in the newly opened tab? I deleted the configuration of overwriting the homepage and ran the command: npm run dev to restart. Is the previously built plugin configuration still effective?

截图 2024-09-13 18-48-58

I think after restart, the files in dist folder are not updated or changed. The dist folder is not the latest extension。Why is this happening?

So I stopped the project, deleted the dist folder under the project folder, and restarted the project again using npm run dev.

When I open a new tab, I get the same problem as before
截图 2024-09-13 18-59-30

To avoid cache issues, I cleared all past browser data, so I don't think it has anything to do with cache.

无法访问您的文件该文件可能已被移至别处、修改或删除。ERR_FILE_NOT_FOUND == Unable to access your file The file may have been moved, modified, or deleted. ERR_FILE_NOT_FOUND

New findings

1、When creating a new project, first delete "chrome_url_overrides": {"newtab": "newtab/index.html"}, then execute npm run dev, the problem mentioned above will not occur. What is the reason?

2、I deleted node_modules and reinstalled it, which also solved the problem mentioned before. Why?

I hope my content is helpful to you

@cezaraugusto cezaraugusto self-assigned this Sep 16, 2024
@cezaraugusto cezaraugusto added bug Something isn't working and removed needs:developer-validation labels Sep 16, 2024
cezaraugusto added a commit that referenced this issue Sep 20, 2024
@cezaraugusto
Copy link
Member

hey @ApacheAlpha thanks for kind words and the detailed write-up, it ended up being the very issue you found and I'm happy to say it's fixed in the current release 👍

let me know how it goes on your end!

@cezaraugusto cezaraugusto added needs:developer-validation and removed bug Something isn't working labels Sep 22, 2024
@ApacheAlpha
Copy link
Author

@cezaraugusto

Thank you for your hard work. After my test, I found that the problem has not been solved. My execution process is as follows.

The first step is to execute the command:

npx extension create test-extensions-new-react --template=new-react

截图 2024-09-24 07-34-37

The second step is to open the project file and execute the command: npm run dev

image

The third step is to delete the project configuration file:

"chrome_url_overrides": { "newtab": "newtab/index.html" },

Use Ctrl + C to stop the project then execute the command: rm -rf dist && npm run dev

When I open a new tab ,The problems mentioned above still exist

image

Sorry, I mean no harm.

New findings

I found that if I delete the node_modules file first, then install npm i and then execute the command rm -rf dist && npm run dev There won't be any problem. So I think this problem is closely related to your Extension library.

image

@cezaraugusto
Copy link
Member

thanks again @ApacheAlpha, that's an interesting behavior. not sure the fix yet but will update the issue title to reflect the current bug.

@cezaraugusto cezaraugusto changed the title --template=tailwind Deleting the chrome_url_overrides configuration in the manifest.json file causes an error Field chrome_url_overrides persists in browser profile even after removal Sep 28, 2024
@cezaraugusto cezaraugusto added bug Something isn't working browser:all help wanted Extra attention is needed and removed needs:developer-validation labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:all bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants