Enable copy and paste for a site that doesn't allow itHow do I copy to the clipboard in JavaScript?HTML text input allow only numeric inputHow to allow only numeric (0-9) in HTML inputbox using jQuery?Disable/enable an input with jQuery?jQuery disable/enable submit buttonXmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-OriginCopy array by valueHow does Access-Control-Allow-Origin header work?Why does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?JQuery / JavaScript character limit counter and text highlight
Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?
In season 17 does LoN buff work against season journey set rewards?
Promotion comes with unexpected 24/7/365 on-call
Wireless headphones interfere with Wi-Fi signal on laptop
Holding rent money for my friend which amounts to over $10k?
Windows 10 lock screen - display my own random images
Why were the bells ignored in S8E5?
What is this weird d12 for?
Polynomial division: Is this trick obvious?
Wifi is sometimes soft blocked by unknown service
Is random forest for regression a 'true' regression?
labelled end points on logic diagram
Would life always name the light from their sun "white"
Why when I add jam to my tea it stops producing thin "membrane" on top?
Will consteval functions allow template parameters dependent on function arguments?
Why did Varys remove his rings?
Can I say: "When was your train leaving?" if the train leaves in the future?
UUID type for NEWID()
Why would someone open a Netflix account using my Gmail address?
Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?
Can anyone give me examples of the relative-determinative 'which'?
How to handle professionally if colleagues has referred his relative and asking to take easy while taking interview
Why are goodwill impairments on the statement of cash-flows of GE?
Formal Definition of Dot Product
Enable copy and paste for a site that doesn't allow it
How do I copy to the clipboard in JavaScript?HTML text input allow only numeric inputHow to allow only numeric (0-9) in HTML inputbox using jQuery?Disable/enable an input with jQuery?jQuery disable/enable submit buttonXmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-OriginCopy array by valueHow does Access-Control-Allow-Origin header work?Why does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?JQuery / JavaScript character limit counter and text highlight
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
First off, I want to say that I very little knowledge of coding so please bear with me. I'm trying to paste in a site that doesn't allow it. This is the link to the javascript that they used to block it, https://mychatdashboard.com/js/messages.js?v=1.3
A friend of mine is helping me with it and he suggested that I put this in the javascript console in the DevTools of Google Chrome,
handler = function(e) e.stopImmediatePropagation(); return true;
document.querySelector('#conversation-content .conversation-message-text').addEventListener('keyup', handler, true)
document.querySelector('#conversation-content .conversation-message-text').addEventListener('input', handler, true)
This does solve the problem but it creates another issue. It seems that it interferes with this section of the javascript that I have linked to,
* Function to update the messagebox. (Enable/disable send button,
* change the color class, update the counter)
* @return void
So what would happen is that when a message is typed in the textbook, there's a character counter at the top which shows how many characters are written. When 80 characters(I think it's 80) are typed, the send button will be enabled so that I can send the message. However, with the javascript code that my friend suggested that I used, it stops the counter from working altogether so the send button never gets highlighted.
Is there any way around this? Please let me know if further clarifications are needed since it's the first time I'm asking a question of this nature.
javascript jquery
add a comment |
First off, I want to say that I very little knowledge of coding so please bear with me. I'm trying to paste in a site that doesn't allow it. This is the link to the javascript that they used to block it, https://mychatdashboard.com/js/messages.js?v=1.3
A friend of mine is helping me with it and he suggested that I put this in the javascript console in the DevTools of Google Chrome,
handler = function(e) e.stopImmediatePropagation(); return true;
document.querySelector('#conversation-content .conversation-message-text').addEventListener('keyup', handler, true)
document.querySelector('#conversation-content .conversation-message-text').addEventListener('input', handler, true)
This does solve the problem but it creates another issue. It seems that it interferes with this section of the javascript that I have linked to,
* Function to update the messagebox. (Enable/disable send button,
* change the color class, update the counter)
* @return void
So what would happen is that when a message is typed in the textbook, there's a character counter at the top which shows how many characters are written. When 80 characters(I think it's 80) are typed, the send button will be enabled so that I can send the message. However, with the javascript code that my friend suggested that I used, it stops the counter from working altogether so the send button never gets highlighted.
Is there any way around this? Please let me know if further clarifications are needed since it's the first time I'm asking a question of this nature.
javascript jquery
add a comment |
First off, I want to say that I very little knowledge of coding so please bear with me. I'm trying to paste in a site that doesn't allow it. This is the link to the javascript that they used to block it, https://mychatdashboard.com/js/messages.js?v=1.3
A friend of mine is helping me with it and he suggested that I put this in the javascript console in the DevTools of Google Chrome,
handler = function(e) e.stopImmediatePropagation(); return true;
document.querySelector('#conversation-content .conversation-message-text').addEventListener('keyup', handler, true)
document.querySelector('#conversation-content .conversation-message-text').addEventListener('input', handler, true)
This does solve the problem but it creates another issue. It seems that it interferes with this section of the javascript that I have linked to,
* Function to update the messagebox. (Enable/disable send button,
* change the color class, update the counter)
* @return void
So what would happen is that when a message is typed in the textbook, there's a character counter at the top which shows how many characters are written. When 80 characters(I think it's 80) are typed, the send button will be enabled so that I can send the message. However, with the javascript code that my friend suggested that I used, it stops the counter from working altogether so the send button never gets highlighted.
Is there any way around this? Please let me know if further clarifications are needed since it's the first time I'm asking a question of this nature.
javascript jquery
First off, I want to say that I very little knowledge of coding so please bear with me. I'm trying to paste in a site that doesn't allow it. This is the link to the javascript that they used to block it, https://mychatdashboard.com/js/messages.js?v=1.3
A friend of mine is helping me with it and he suggested that I put this in the javascript console in the DevTools of Google Chrome,
handler = function(e) e.stopImmediatePropagation(); return true;
document.querySelector('#conversation-content .conversation-message-text').addEventListener('keyup', handler, true)
document.querySelector('#conversation-content .conversation-message-text').addEventListener('input', handler, true)
This does solve the problem but it creates another issue. It seems that it interferes with this section of the javascript that I have linked to,
* Function to update the messagebox. (Enable/disable send button,
* change the color class, update the counter)
* @return void
So what would happen is that when a message is typed in the textbook, there's a character counter at the top which shows how many characters are written. When 80 characters(I think it's 80) are typed, the send button will be enabled so that I can send the message. However, with the javascript code that my friend suggested that I used, it stops the counter from working altogether so the send button never gets highlighted.
Is there any way around this? Please let me know if further clarifications are needed since it's the first time I'm asking a question of this nature.
javascript jquery
javascript jquery
asked Mar 23 at 15:16
darksidedarkside
1
1
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
There are numerous way through one can copy contents from Right Click protected sites
- By disabling browser JavaScript in browser
- Using Proxy Sites
- By Using the source code of the site
Disabling JavaScript in Browsers [Google Chrome]
In Chrome browser, you can quickly disable JavaScript by going to settings. See the screenshot for better explanation:
screenshot
Through Viewing Source Code
f you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to source of the page, which you can access directly using the format below or by right click. Since, right click is out of question here, we will simply open chrome browser and type: view-source: before the post URl Like
view-source:Enable copy and paste for a site that doesn't allow it
Press ctrl+u
And find the paragraph or text you want to copy and then paste it into any text editor.
add a comment |
The JavaScript you're entering into the DevTools console is defining a function named handler
and then adding it as an event handler for keyup
and input
events for a field on the page you're viewing (presumable the chat window textbox).
The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters).
For this sites (and I haven't been able to test it) instead of the code you've used you could try running this in the DevTools console (once the page is loaded):
restrictCopyPasteByKeyboard = function () return true; ;
This should redefine the function that's preventing you from using paste (I can't test it out because I can't access that site).
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
I think the correct thing to put waswindow.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect
– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was thisfunction inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.
– darkside
Mar 25 at 13:27
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315209%2fenable-copy-and-paste-for-a-site-that-doesnt-allow-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are numerous way through one can copy contents from Right Click protected sites
- By disabling browser JavaScript in browser
- Using Proxy Sites
- By Using the source code of the site
Disabling JavaScript in Browsers [Google Chrome]
In Chrome browser, you can quickly disable JavaScript by going to settings. See the screenshot for better explanation:
screenshot
Through Viewing Source Code
f you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to source of the page, which you can access directly using the format below or by right click. Since, right click is out of question here, we will simply open chrome browser and type: view-source: before the post URl Like
view-source:Enable copy and paste for a site that doesn't allow it
Press ctrl+u
And find the paragraph or text you want to copy and then paste it into any text editor.
add a comment |
There are numerous way through one can copy contents from Right Click protected sites
- By disabling browser JavaScript in browser
- Using Proxy Sites
- By Using the source code of the site
Disabling JavaScript in Browsers [Google Chrome]
In Chrome browser, you can quickly disable JavaScript by going to settings. See the screenshot for better explanation:
screenshot
Through Viewing Source Code
f you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to source of the page, which you can access directly using the format below or by right click. Since, right click is out of question here, we will simply open chrome browser and type: view-source: before the post URl Like
view-source:Enable copy and paste for a site that doesn't allow it
Press ctrl+u
And find the paragraph or text you want to copy and then paste it into any text editor.
add a comment |
There are numerous way through one can copy contents from Right Click protected sites
- By disabling browser JavaScript in browser
- Using Proxy Sites
- By Using the source code of the site
Disabling JavaScript in Browsers [Google Chrome]
In Chrome browser, you can quickly disable JavaScript by going to settings. See the screenshot for better explanation:
screenshot
Through Viewing Source Code
f you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to source of the page, which you can access directly using the format below or by right click. Since, right click is out of question here, we will simply open chrome browser and type: view-source: before the post URl Like
view-source:Enable copy and paste for a site that doesn't allow it
Press ctrl+u
And find the paragraph or text you want to copy and then paste it into any text editor.
There are numerous way through one can copy contents from Right Click protected sites
- By disabling browser JavaScript in browser
- Using Proxy Sites
- By Using the source code of the site
Disabling JavaScript in Browsers [Google Chrome]
In Chrome browser, you can quickly disable JavaScript by going to settings. See the screenshot for better explanation:
screenshot
Through Viewing Source Code
f you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to source of the page, which you can access directly using the format below or by right click. Since, right click is out of question here, we will simply open chrome browser and type: view-source: before the post URl Like
view-source:Enable copy and paste for a site that doesn't allow it
Press ctrl+u
And find the paragraph or text you want to copy and then paste it into any text editor.
answered Mar 23 at 15:47
Matias CorvalanMatias Corvalan
1
1
add a comment |
add a comment |
The JavaScript you're entering into the DevTools console is defining a function named handler
and then adding it as an event handler for keyup
and input
events for a field on the page you're viewing (presumable the chat window textbox).
The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters).
For this sites (and I haven't been able to test it) instead of the code you've used you could try running this in the DevTools console (once the page is loaded):
restrictCopyPasteByKeyboard = function () return true; ;
This should redefine the function that's preventing you from using paste (I can't test it out because I can't access that site).
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
I think the correct thing to put waswindow.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect
– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was thisfunction inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.
– darkside
Mar 25 at 13:27
add a comment |
The JavaScript you're entering into the DevTools console is defining a function named handler
and then adding it as an event handler for keyup
and input
events for a field on the page you're viewing (presumable the chat window textbox).
The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters).
For this sites (and I haven't been able to test it) instead of the code you've used you could try running this in the DevTools console (once the page is loaded):
restrictCopyPasteByKeyboard = function () return true; ;
This should redefine the function that's preventing you from using paste (I can't test it out because I can't access that site).
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
I think the correct thing to put waswindow.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect
– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was thisfunction inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.
– darkside
Mar 25 at 13:27
add a comment |
The JavaScript you're entering into the DevTools console is defining a function named handler
and then adding it as an event handler for keyup
and input
events for a field on the page you're viewing (presumable the chat window textbox).
The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters).
For this sites (and I haven't been able to test it) instead of the code you've used you could try running this in the DevTools console (once the page is loaded):
restrictCopyPasteByKeyboard = function () return true; ;
This should redefine the function that's preventing you from using paste (I can't test it out because I can't access that site).
The JavaScript you're entering into the DevTools console is defining a function named handler
and then adding it as an event handler for keyup
and input
events for a field on the page you're viewing (presumable the chat window textbox).
The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters).
For this sites (and I haven't been able to test it) instead of the code you've used you could try running this in the DevTools console (once the page is loaded):
restrictCopyPasteByKeyboard = function () return true; ;
This should redefine the function that's preventing you from using paste (I can't test it out because I can't access that site).
edited Mar 25 at 12:58
answered Mar 23 at 15:53
dariomdariom
3,9952440
3,9952440
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
I think the correct thing to put waswindow.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect
– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was thisfunction inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.
– darkside
Mar 25 at 13:27
add a comment |
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
I think the correct thing to put waswindow.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect
– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was thisfunction inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.
– darkside
Mar 25 at 13:27
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
I just tried it but I got an error about 'Uncaught SyntaxError: Unexpected token true' This word "true" is underlined in red in DevTools.
– darkside
Mar 23 at 15:59
1
1
I think the correct thing to put was
window.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect– darkside
Mar 23 at 23:49
I think the correct thing to put was
window.restrictCopyPasteByKeyboard = function()
That's what I replaced it with but it didn't seem to have any effect– darkside
Mar 23 at 23:49
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
Try returning true from the function. I've updated my answer to reflect what I think it should be (you were right, my syntax was wrong!)
– dariom
Mar 25 at 12:57
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was this
function inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.– darkside
Mar 25 at 13:27
I used that syntax but it didn't work either. I have all but given up. The last thing I tried was this
function inputHander(e) e.stopImmediatePropagation(); return true; const elem = document.querySelector('#conversation-content .conversation-message-text'); if (elem) elem.addEventListener('keyup', inputHander, true); elem.addEventListener('input', inputHander, true); const buttons = document.querySelectorAll('button'); Array.prototype.forEach.call(buttons, function(button) button.disabled = false; );
Using that code still disabled the counter.– darkside
Mar 25 at 13:27
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315209%2fenable-copy-and-paste-for-a-site-that-doesnt-allow-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown