Skip to content

Commit

Permalink
Merge pull request #847 from orbital17/gh-pages
Browse files Browse the repository at this point in the history
Fix Clipboard API method names
  • Loading branch information
markafoltz authored Dec 3, 2024
2 parents 552bfcb + 2ade49f commit ec85e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions async-clipboard/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ document.querySelector('#paste').addEventListener('click', () => {
/** Watch for pastes */
document.addEventListener('paste', e => {
e.preventDefault();
navigator.clipboard.getText().then(text => {
navigator.clipboard.readText().then(text => {
ChromeSamples.log('Updated clipboard contents: ' + text);
});
});
Expand All @@ -45,7 +45,7 @@ document.querySelectorAll('[data-permission]').forEach(btn => {
});
btn.addEventListener('click', () => {
Promise.resolve().then(() => {
return navigator.permissions.request({name: permission});
return navigator.permissions.query({name: permission});
})
.then(status => {
ChromeSamples.log('Permission: ' + status.state);
Expand Down

0 comments on commit ec85e28

Please sign in to comment.