Page 1 of 1

Cant select text, though noScript is on

Posted: Fri Mar 27, 2009 6:01 am
by Qiao
Hi!

http://www.sp-z.com/zt322801/htmlmodel/ ... 93480.html
I cannot select text on the right here, though NoScript is on. The reason is script in the bottom of the page.

Is it bug? I think there should be no problems selecting text with NoScript.

Re: Cant select text, though noScript is on

Posted: Fri Mar 27, 2009 6:21 am
by Nan M
Default install, test profile with NS only.

Confirm unable to highlight text

Default install, test profile with NS disabled

Still unable to highlight text

It doesn't appear to be a NS problem.

Are you able to get the latest updates for Firefox and NoScript?

Re: Cant select text, though noScript is on

Posted: Fri Mar 27, 2009 6:46 am
by GµårÐïåñ
Qiao wrote:Hi!

http://www.sp-z.com/zt322801/htmlmodel/ ... 93480.html
I cannot select text on the right here, though NoScript is on. The reason is script in the bottom of the page.

Is it bug? I think there should be no problems selecting text with NoScript.
I can confirm going to the site myself, I cannot copy text either. However, I was able to copy just fine the area near the form at the bottom.

Code: Select all

标题  	 :  	  
内容 	: 	 
联系人 	: 	 
联系电话 	: 	 
电子邮件 	: 	 
公司名称 	: 	 
联系地址 	: 	 
验证码 	: 	  点击换一张
  
注:1.可以使用快捷键Alt+S或Ctrl+Enter发送信息!
        2.如有必要,请您留下您的详细联系方式! 
But I noticed no fix by disabling NoScript, therefore it is safe to assume that it is NOT a NoScript issue and its either coded that way by the website or somehow rendering in a way that cannot be selected. Given that part of the page is selectable and part of it not, suggests it was made this way by design and therefore eliminates NoScript as the problem. Hopefully when he has time, Giorgio can confirm this?

Re: Cant select text, though noScript is on

Posted: Fri Mar 27, 2009 6:54 am
by GµårÐïåñ
Found the culprit. It is this code reference:

Code: Select all

<style>body{-moz-user-select: none;}</style><script src='http://styleweb.sp-z.com/JavaScript/CanCopy.js' language='javascript'></script>
Designed to block copying. There is supposed to be alerts when you try but since NoScript has disabled the code, it won't pop up to say anything.

Code: Select all

function selectstart()      
{
	event.returnValue=false;
}

function mousedown() 
{
	if (event.button==2)
	{
	  event.returnValue=false;
	}
}

function keydown()
{
	if (event.ctrlKey)
	{
		event.returnValue=false;
	}
}

document.onselectstart=selectstart;
document.onmousedown=mousedown;
document.onkeydown=keydown;

if(window.attachEvent)
{
    window.attachEvent("onload",onloadEvent);
}
else
{
    window.addEventListener("load",onloadEvent,false);
}

function onloadEvent()
{
    document.body.oncopy=function()
    {  //alert(LanguageCode);
//       switch(LanguageCode)
//       {
//            case 936:
//                alert('??????????????,????!');
//                break;
//            case 932:
//                alert('????????????????????????????????!');
//                break;
//            case 950:
//                alert('??????????????,????!');
//                break;
//            case 1252:
//                alert('To Protect Company good, this page is Forbidded to copy, Pardon!');
//                break;
//            case 20106:
//                alert('Um die Austeller zu schutzen, Copie dieser Seite ist verboten. Entschuldigen Sie, bitte.');
//                break;
//            default:
//                break;
//       }
       event.returnValue = false;
       clipboardData.clearData();
    }
}



Hope that helps.