Skip to content

Chrome Extension that allows clipboard read and write without user interaction.

License

Notifications You must be signed in to change notification settings

milohansen/AllowClipboard

 
 

Repository files navigation

AllowClipboard

Chrome Extension that allows clipboard read and write without user interaction. Normally Chrome does not allow JavaScript access to the Clipboard without a user interaction (e.g. click). AllowClipboard extension can be useful in situations where clipboard access is needed out of band, such as during an asynchronous method call from the server.

Chrome Extension

Allow Clipboard - Chrome Web Store

NuGet

Client TypeScript: https://www.nuget.org/packages/AllowClipboard.Client.TypeScript

Overview

This project is written primarily in TypeScript. TypeScript files are compiled to JavaScript and placed in the AllowClipboardExtension folder of the project folder.

Debugging

  1. Run `npm install`
  2. If first run, build project so that JavaScript files are generated to AllowClipboardExtension by executing tsc in the project directory.
    • Note: To watch and auto generate JS files on save execute `tsc -w`
  3. Download Chrome Apps & Extensions Developer Tool.
  4. Open Chrome Apps & Extensions Developer Tool.
  5. Select Extensions Tab.
  6. Click Load unpacked...
  7. Choose path to AllowClipboardExtension.
  8. Open a Chrome window.
  9. JavaScript injected into the webpage context will be available. (allowClipboardClient.ts and common.ts)

Example

In Webpage Context:

var clipboardClient = new AllowClipboard.Client.ClipboardClient();
clipboardClient.write("Worked!", function(success){console.log(success)});
clipboardClient.read(function(success,data){console.log(data)});

Should print out "Worked!"

About

Chrome Extension that allows clipboard read and write without user interaction.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.5%
  • JavaScript 9.1%
  • HTML 4.3%
  • C# 2.1%