better organization, add in eslint as well as package and other helper bookmarklets found on confluence to have here if needed as a reference
This commit is contained in:
21
src/utils/bookmarklets/hashid.js
Normal file
21
src/utils/bookmarklets/hashid.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This JavaScript function takes a string, decodes it using decodeURIComponent,
|
||||
* alerts the decoded string, and copies the result to the clipboard.
|
||||
*
|
||||
* The function works as follows:
|
||||
* 1. Takes a string as input.
|
||||
* 2. Decodes the string using decodeURIComponent.
|
||||
* 3. Alerts the decoded string.
|
||||
* 4. Copies the decoded string to the clipboard.
|
||||
*
|
||||
* Note: This function uses the Clipboard API which might not be fully supported in all browsers.
|
||||
*/
|
||||
javascript:(function() {
|
||||
let answer = prompt("Enter the HashID");
|
||||
let decodedStr = decodeURIComponent(answer);
|
||||
alert(decodedStr);
|
||||
|
||||
navigator.clipboard.writeText(decodedStr)
|
||||
.then(() => console.log('Decoded string copied to clipboard'))
|
||||
.catch(err => console.error('Error in copying decoded string to clipboard: ', err));
|
||||
})();
|
||||
Reference in New Issue
Block a user