-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to js script but it does not seem to work #17
Comments
Hi @ondrobaco It seems to be because
As an alternative, i have rewritten the script with reference to the following. function copyTextToClipboard(text) {
//Create a textbox field where we can insert text to.
var copyFrom = document.createElement("textarea");
//Set the text content to be the text you wished to copy.
copyFrom.textContent = text;
//Append the textbox field into the body as a child.
//"execCommand()" only works when there exists selected text, and the text is inside
//document.body (meaning the text is part of a valid rendered HTML element).
document.body.appendChild(copyFrom);
//Select all the text!
copyFrom.select();
//Execute command
document.execCommand('copy');
//(Optional) De-select the text using blur().
copyFrom.blur();
//Remove the textbox field from the document.body, so no other JavaScript nor
//other elements can get access to this.
document.body.removeChild(copyFrom);
}
messageId = document.querySelector('div[data-legacy-message-id]').getAttribute('data-legacy-message-id');
user = location.pathname.match(/\/u\/(\d)/)[1];
copyTextToClipboard('https://mail.google.com/mail/u/' + user + '/#inbox/' + messageId); It is working fine at hand. Thanks. |
Thank you, it works! Forever grateful :)! |
You're welcome! Thanks. |
Hi onozaty, |
I will send you a set of files that I have verified to work.
Thanks. |
hey Onazaty,
thank you for your help.
However, it still does not work.
I copied the whole src over the existing files in the extension folder.
I also enabled developer mode on the extension page of the browser.
It says the extension may have been corrupted and when I click Repair,
it installs the extension from the webstore.
[image: image.png]
…On Wed, Jun 26, 2024 at 7:42 PM onozaty ***@***.***> wrote:
I will send you a set of files that I have verified to work.
Please unzip and load this.
- src.zip <https://github.com/user-attachments/files/15985847/src.zip>
clipboardWrite is added to the manifest.json permissions.
The script uses navigator.clipboard.writeText.
Thanks.
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADDLPRKJFEXRDPGJ6XLRVDZJKEITAVCNFSM6AAAAABJ46MEL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGI3DGNZSGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Instead of overwriting the extensions folder, could you please load the folder where you extracted the src.zip with Load Unpacked Extension? If you have already installed it from the Chrome Web Store, please disable it. |
I just did it. Works beautifully!
Thank you so much.
Can I do anything for you?
Leave a review for something etc?
…On Wed, Jun 26, 2024 at 10:52 PM onozaty ***@***.***> wrote:
Instead of overwriting the extensions folder, could you please load the
folder where you extracted the src.zip with Load Unpacked Extension?
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADDLPVMURU6AF2TGQFESCLZJK2QJAVCNFSM6AAAAABJ46MEL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGYYTKNZUGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
If you haven't written a review on the Chrome Web Store, I would appreciate it if you would. Thanks. |
Hi, thanks for a great extension.
I'm trying putting the following script under a short cut with the extension but it does not seem to execute.
https://gist.github.com/alangrainger/ef52d535f7b1cc4c0c1b23da4e91806d
It works fine when the script is used in bookmark.
I tried to put the code under script as well as url, but none of the options work.
Would you know where could be the problem?
The text was updated successfully, but these errors were encountered: