-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use browser clipboard api in a safe manner (#26)
PLT-8060
- Loading branch information
Showing
5 changed files
with
130 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Contrib.Web.Clipboard where | ||
|
||
import Prelude | ||
import Effect (Effect) | ||
import Data.Undefined.NoProblem (Opt, opt) | ||
import Web.Clipboard as Clipboard | ||
import Web.Clipboard (Clipboard) | ||
import Web.HTML (Navigator) | ||
|
||
clipboard :: Navigator -> Effect (Opt Clipboard) | ||
clipboard n = do | ||
c <- Clipboard.clipboard n | ||
-- This makes it safe | ||
pure $ opt c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters