Skip to content

fix manifest v3 issue#13

Open
nikkiBot wants to merge 1 commit intomehulmpt:masterfrom
nikkiBot:master
Open

fix manifest v3 issue#13
nikkiBot wants to merge 1 commit intomehulmpt:masterfrom
nikkiBot:master

Conversation

@nikkiBot
Copy link
Copy Markdown

ss
Manifest v2 is now deprecated, and thus the shift to v3 was needed

@optimisan
Copy link
Copy Markdown

Great, I was just working on this

Copy link
Copy Markdown

@optimisan optimisan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few suggestions, I will appreciate if you take a look!

Comment on lines +23 to +27
"script.js",
"style.css",
"icon.png",
"manifest.json",
"csp.js"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you need all these?

Only csp.js is working for me.

Comment on lines +32 to +33
script.src = chrome.runtime.getURL('public/csp.js') ;
(document.head || document.documentElement).appendChild(script);
Copy link
Copy Markdown

@optimisan optimisan Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor content.ts

Since csp.js is a separate file, I think content.ts is doing too many things.

We can remove this disabling business out of content.ts and keep this as a content script instead of injecting.

csp.js will inject the code instead, which can be something like this:

const disablingCode = ```$('#sortable_nav').sortable('destroy');
$('#sortable_nav').enableSelection();
```
const script = document.createElement('script');
script.textContent = disablingCode;
(document.head || document.documentElement).appendChild(script);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a separate pull request though.

"activeTab",
"scripting"
],
"action": {},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default_icon key is recommended here (which is basically a copy-paste from the icons above).

Also, you can add a default_title here that is shown as a tooltip on hover:

"action": {
		"default_icon": {
			"32": "icon.png",
			"48": "icon.png",
			"64": "icon.png",
			"128": "icon.png"
		},
		"default_title": "Click to run PS-Extender"
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants