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

Mediapipe No Longer Compatible With Chrome Extensions #4028

Closed
nskaiser opened this issue Jan 24, 2023 · 5 comments
Closed

Mediapipe No Longer Compatible With Chrome Extensions #4028

nskaiser opened this issue Jan 24, 2023 · 5 comments
Assignees
Labels
legacy:selfie segmentation Issues related to selfie segmentation platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution

Comments

@nskaiser
Copy link

Hello,

We are unable to submit Chrome Extensions that use Mediapipe due to the new Manifest V3 requirement.

In manifest v3 the script-src directive in content_security_policy.extension_pages does not allow the use of "unsafe-eval" as mentioned here - https://developer.chrome.com/docs/extensions/mv3/mv3-migration/#content-security-policy

If "unsafe-eval" can't be specified for script-src then methods like eval() or Function(), which create functions from strings, are blocked as described here - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_eval_expressions

When we load https://cdn.jsdelivr.net/npm/@mediapipe/holistic/holistic_solution_wasm_bin.js there is a function called createNamedFunction() which uses new Function() to create functions by given name and body. Since "unself-eval" can't be specified for script-src directive then this method is blocked and an error is thrown.

I have spoken to the Google Chrome Store team and they will not make any exceptions to the Manifest V3 requirement.

Is this something that can be quickly addressed?

@nskaiser nskaiser added the type:bug Bug in the Source Code of MediaPipe Solution label Jan 24, 2023
@ayushgdev ayushgdev added platform:javascript MediaPipe Javascript issues legacy:selfie segmentation Issues related to selfie segmentation labels Jan 25, 2023
@ayushgdev
Copy link
Collaborator

Hello @nskaiser
Thanks for raising this issue. We do understand that chrome extensions are a popular requirement by community for MediaPipe as a platform. However, unsafe-eval is required by the solutions for the time being. We have received other issues in the past around the same requirements (#3458 , #3723 ). Post internal discussions, it was concluded that though this is possible on its own, it will have repercussions around the functionality of the MediaPipe solution. Hence this is not a priority right now.

@ayushgdev ayushgdev added the stat:awaiting response Waiting for user response label Jan 25, 2023
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@tyrmullen
Copy link

A quick patch has been released for all utilities modules:

  • drawing_utils (0.3.1675466124)
  • control_utils_3d (0.3.1675466062)
  • control_utils (0.6.1675466023)
  • camera_utils (0.3.1675465971)

As well as the following JS solutions:

  • hands (0.4.1675469240)
  • pose (0.5.1675469404)
  • holistic (0.5.1675471629)
  • objectron (0.4.1675468480)
  • selfie_segmentation (0.1.1675465747)

Hopefully this can address your issue; please let us know if that's not the case! Note that we were not yet able to update the remaining two JS solutions, so these will continue to have this issue:

  • face_detection
  • face_mesh

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@kuaashish kuaashish removed stat:awaiting response Waiting for user response stale labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:selfie segmentation Issues related to selfie segmentation platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution
Projects
None yet
Development

No branches or pull requests

5 participants