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

Support for Independent Javascript Library (Not as Browser Extension) #78

Open
derks opened this issue Apr 7, 2022 · 4 comments
Open

Comments

@derks
Copy link

derks commented Apr 7, 2022

I've been digging to find a JS library that will add this natively to a web app, rather than a user having to install an extension in their browser. It would be great if this project also supported that use-case, rather than creating/forking a new project.

Ideally, I would be able to just import this library locally, or from something like CDNJS and load it on any web app. Similar to how highlight.js works:

Context: In some use-cases, users are required to disable all browser extensions before proceeding with a task (ex: taking an exam/certification/etc using an online proctoring service).

@Glennmen
Copy link
Collaborator

Glennmen commented Apr 7, 2022

Have you looked at this library? https://github.com/zenorocha/clipboard.js
This is what codecopy uses "under the hood".

@derks
Copy link
Author

derks commented Apr 7, 2022

@Glennmen Yes, I am familiar with that... and that project helped get the built-in support for copy to clipboard. What I'm looking for is the "automatically for any code block" feature... which, funny enough, that library references this project for.

I guess I'm looking for best of both worlds, built into my apps that do not require the end-user to install anything (primarily for users who are unable to install anything due to restrictions noted in the op). I'm perfectly OK forking my own internal project to solve this, just feels like it makes sense that one of these two projects would support it as it is in the same wheel house and I think a valid use-case.

Really appreciate the feedback and consideration. Should I move this request to clipboard.js?

@Glennmen
Copy link
Collaborator

Glennmen commented Apr 7, 2022

So you are looking for exactly this project but compiled into a library.

@derks
Copy link
Author

derks commented Apr 7, 2022

@Glennmen yes, that's correct. This request might fit better in clipboard.js, but since that project links to this project I landed here. Happy to move it to clipboard.js and/or provide any other details that might help.

Some additional context: Often the HTML is automatically generated (for example, from Markdown) so having a library that operates on any <pre> or <code> (like codecopy does) fits well since adding id's/classes might not be possible (easily) for many use cases even if plugging into an app I own.

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

No branches or pull requests

2 participants