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
feat: Power User Script online version #2836
Conversation
Do you want to maintain the user script in this repository from now on? |
@hangy : the idea is to make it available directly in Product Opener, for some users, without requiring installing things. @CharlesNepote @teolemon : live on https://fr.openfoodfacts.dev/ for admins only right now, we may want to think of how to surface it, e.g. make it an option in the user profile or something. |
On the one hand the Power User Script is useful for some people but:
So we would like to try if Power User Script can be launched directly on the server side, but reserved for admins and moderators (due to mass edit). Also it would be a good thing to make it optional for users: an option should allow each users to activate it or not. On the other hand:
IMHO what is sure is that we need easier ways to prototype user scripts / enhanced UI / test UIs / "labs" functionalities. Wikipedia allows users script. We should find a very simple way to do it: both easy for front-end devs and users. |
I just rebased the branch |
Stale pull request message |
@@ -7193,6 +7201,10 @@ HTML | |||
my $html; | |||
|
|||
# init javascript code | |||
# Kept those 3 lines during the rebase. Not evident if needed @CharlesNepote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CharlesNepote I rebased the Power User Script branch. but I was not sure about those 3 lines. Can I delete them ?
SonarCloud Quality Gate failed. 1 Bug No Coverage information |
SonarCloud Quality Gate failed. 1 Bug No Coverage information |
if(proPlatform) { | ||
var publicURL = document.URL.replace(/\.pro\./gi, "."); | ||
console.log("publicURL: "+publicURL); | ||
$(".sidebar p:first").after('<p>> <a href="'+publicURL+'">Product public URL</a></p>'); |
Check failure
Code scanning / SonarCloud
DOM updates should not lead to cross-site scripting (XSS) attacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
SonarCloud Quality Gate failed. 1 Bug No Coverage information |
@teolemon @CharlesNepote I'm going through old PRs. This one is 4 years old. I suggest that we close it, and that we decide on what we want to do first, as there are many different ways we could make power user script, or part of it, more easily available to some users. |
Fine by me. I will prioritize the associated issue. |
What