• 0

Javascript New Window Help


Question

I have been asked to help with a site because their old developer went out of business. THey built a custom asp.net website that sells house plans and they insist on disabling right click with a body tag using the "oncontextmenu" method. So fine... but they allow larger previewing of the homes using a javascript window opener to show the enlarged image. Problem is the new window allows right click. I have gone through all the code and pinpointed the code below which enables the window opener to preview the pictures:


{
HtmlImage imgSmallImage = (HtmlImage)e.Item.FindControl("imgSmallImage");
imgSmallImage.Attributes.Add("onClick", "javascript:image_open('houses/" + DataBinder.Eval(e.Item.DataItem, "PlanImage") + "')");

}
[/CODE]

My question, is there any way to disable right click by modifiying this opening code so the image in this new window can't be right clicked. I see no other way and javascript isnt my strong point. I wish the client would just not do this but they insist.

Thank you very much

Link to comment
https://www.neowin.net/forum/topic/1058520-javascript-new-window-help/
Share on other sites

2 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Posts

    • Shutter Encoder 20.2 by Razvan Serea Shutter Encoder is one of the best video converter software and image, audio available today. It has been designed by video editors in order to be as accessible and efficient as possible. It is one of the few free professional tools. Based on FFmpeg, it has the largest codec library available. You can thus convert your files into many different formats. Complete settings for the most advanced Shutter Encoder has a panel containing a large number of settings, in order to define your own choices based on your files and perfect your video or audio output. Well-thought-out settings, with parameters predefined to create files quickly and easily. List of functions Without conversion: Cut without re-encoding, Replace audio, Rewrap, Conform, Merge, Extract, Subtitling, Video inserts Sound conversions: WAV, AIFF, FLAC, MP3, AAC, AC3, OPUS, OGG Editing codecs: DNxHD, DNxHR, Apple ProRes, QT Animation, GoPro CineForm, Uncompressed YUV Output codecs: H.264, H.265, VP9, AV1, OGV Broadcast codecs XDCAM HD422, AVC-Intra 100, XAVC, HAP....and much more. Shutter Encoder 20.2 changelog: Added "Intel Quick Sync" hardware acceleration for Linux Added 'Identify speakers' option for "Audio transcription" function Improved installer package Improved video player performance Improved timecode display with drop-frame videos Improved naming convention for surround audio files Fixed splash screen freeze Fixed bug with file hanging Fixed bugs with presets loading Fixed bugs with video player's buffer Fixed bug with 'Total length of file' option Fixed bugs with 'Record screen/device' option Fixed bug with "XAVC" & "XAVC Long GOP" functions Rollback to XPDF tool for PDF conversion Removed unused binary architecture for Mac Various corrections Various improvements Download: Shutter Encoder 20.2 | 166.0 MB (Open Source) Download: Shutter Encoder Portable | 185.0 MB Links: Shutter Encoder Home Page | FAQ / Tips | macOS | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • did you give it permission to do so? its probably on the ToS. After that South Park episode I'm paying attention to them lol
    • Ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha   No
    • I already have AI "Scareware blocker" on my private profile, it's in "Settings > Privacy, search, and services > Security". I've disabled it because I know what scareware is and don't need AI to tell me.
    • Google are also developing a version that will require you to use an Android device that passes Google Play Integrity for reCAPTCHA challanges: https://reclaimthenet.org/goog...or-de-googled-android-users That will lock people out of various website that don't use Google blessed versions of Android sadly.
  • Recent Achievements

    • Reacting Well
      NovaEdgeX earned a badge
      Reacting Well
    • Week One Done
      NovaEdgeX earned a badge
      Week One Done
    • One Year In
      BA the Curmudgeon earned a badge
      One Year In
    • Conversation Starter
      rosiecharles earned a badge
      Conversation Starter
    • First Post
      KMilenkoski1202 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      536
    2. 2
      +Edouard
      265
    3. 3
      PsYcHoKiLLa
      152
    4. 4
      Steven P.
      99
    5. 5
      macoman
      66
  • Tell a friend

    Love Neowin? Tell a friend!