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.
Allow Clipboard - Chrome Web Store
Client TypeScript: https://www.nuget.org/packages/AllowClipboard.Client.TypeScript
This project is written primarily in TypeScript. TypeScript files are compiled to JavaScript and placed in the AllowClipboardExtension folder of the project folder.
- Run `npm install`
- 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`
- Download Chrome Apps & Extensions Developer Tool.
- Open Chrome Apps & Extensions Developer Tool.
- Select Extensions Tab.
- Click Load unpacked...
- Choose path to AllowClipboardExtension.
- Open a Chrome window.
- JavaScript injected into the webpage context will be available. (allowClipboardClient.ts and common.ts)
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!"