Giter Site home page Giter Site logo

p6laris / cliplazor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 285 KB

ClipLazor is a library that provides interop for the Clipboard API in Blazor applications, allowing you to easily interact with the clipboard.

License: MIT License

C# 18.72% HTML 51.33% CSS 16.79% TypeScript 13.15%
blazor blazor-application blazor-components blazor-server blazor-wasm blazor-webassembly clipboard clipboard-api clipboard-copy clipboard-js

cliplazor's People

Contributors

p00laris avatar p6laris avatar

Watchers

 avatar

cliplazor's Issues

WriteDataAsync does not work in Firefox

If I try to write data into the clipboard in Firefox, I get the following error message:

Error copying data to clipboard: ReferenceError: ClipboardItem is not defined

I'm not sure if it would be possible to fix this as Firefox is not fully supporting clipboard features but maybe there is a fix for this.

I can't read the image from the clipboard

private async Task Incolla()
{

    try
    {
        bool isSupported = await Appunti.IsClipboardSupported();
        bool isReadPermitted = await Appunti.IsPermitted(PermissionCommand.Read);
        if (isReadPermitted)
        {
            var pastedData = await Appunti.ReadDataAsync("image/png");
            if (!pastedData.IsEmpty)
            {
                string pastedImg = Convert.ToBase64String(pastedData.ToArray());

            }
            else
            {
                string dmsg = "Couldn't paste the image";
            }
        }
    }
    catch(Exception ex)
    {
        Console.WriteLine(ex.Message.ToString());
    }

    finally
    {
        await InvokeAsync(StateHasChanged);
    }
}

pasteData is always empty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.