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

[EXP] Example repo that uses commands #1078

Open
2 tasks done
ian opened this issue Sep 18, 2024 · 0 comments
Open
2 tasks done

[EXP] Example repo that uses commands #1078

ian opened this issue Sep 18, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ian
Copy link

ian commented Sep 18, 2024

What is the example you wish to see?

Have tried every which way to add commands to my project and nothing seems to work. It looks like the schema has support for it but nothing seems to bind in-app: https://github.com/PlasmoHQ/plasmo/blob/main/core/parcel-transformer-manifest/src/schema.ts#L146

Shouldn't it be as easy as adding commands to package.json manifest and then binding to them in background.ts?

package.json

"manifest": {
    "commands": {
      "open_side_panel_with_shortcut": {
        "suggested_key": {
          "mac": "MacCtrl+Shift+L",
          "windows": "Ctrl+Shift+L",
          "linux": "Ctrl+Shift+L"
        },
        "description": "Open Side Panel"
      }
    }
  }

background.ts

chrome.commands.onCommand.addListener((command) => {
  if (command === "open_side_panel_with_shortcut") {
    alert("open_side_panel_with_shortcut")
  }
})

Is it possible to expand out examples directory to include an example of how to use commands?

Is there any context that might help us understand?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@ian ian added the documentation Improvements or additions to documentation label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant