Created
April 3, 2016 07:27
-
-
Save JavaScript-Packer/9968664d2139dd3096164aac034fb36b to your computer and use it in GitHub Desktop.
Replace the right click menu on your webpage using JavaScript!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a dataURI/dataURL for you to test it in your web browser:
data:text/html,%3Chtml%3E%3Chead%3E%3Ctitle%3ERight%20Click%20Context%20Menu%20JavaScript%20Replacement%20%2D%20WHAK%2Ecom%3C%2Ftitle%3E%3C%2Fhead%3E%3Cbody%20bgcolor%3D%22silver%22%3E%3Ch1%3ETOP%3C%2Fh1%3E%3Ch3%3ERight%20Click%20Menu%20In%20JavaScript%3C%2Fh3%3E%3Chr%20size%3D%227000%22%20color%3D%22gray%22%3E%0A%3Cscript%3E%0Afunction%20a%28b%29%7Bc%3Ddocument%2Eall%3Fevent%2EclientX%2Bdocument%2Ebody%2EscrollLeft%3Adocument%2Ea%3Fb%2Ex%2Bwindow%2EpageXOffset%3Ab%2EclientX%2Bwindow%2EpageXOffset%3Bd%3Ddocument%2Eall%3Fevent%2EclientY%2Bdocument%2Ebody%2EscrollTop%3Adocument%2Ea%3Fb%2Ey%2Bwindow%2EpageYOffset%3Ab%2EclientY%2Bwindow%2EpageYOffset%7Dvar%20e%2Cf%2Cg%2Cc%3D0%2Cd%3D0%3Bvoid%200%21%3Ddocument%2EaddEventListener%3Fdocument%2EaddEventListener%28%22mousemove%22%2Ca%2C%210%29%3Adocument%2Ea%26%26document%2EcaptureEvents%28Event%2Eb%7CEvent%2Ec%7CEvent%2Ef%29%3Bdocument%2Eonmousemove%3Da%3Bdocument%2Eoncontextmenu%3Dfunction%28%29%7Breturn%211%7D%3Bdocument%2Eonmousedown%3Dfunction%28b%29%7B3%3D%3Db%2Ewhich%26%26%28document%2EgetElementById%28%22contextmenu%22%29%2Estyle%2Eleft%3Dc%2B%22px%22%2Cdocument%2EgetElementById%28%22contextmenu%22%29%2Estyle%2Etop%3Dd%2B%22px%22%2Cdocument%2EgetElementById%28%22contextmenu%22%29%2Estyle%2Evisibility%3D%22visible%22%29%7D%3Bdocument%2Eonmouseup%3Dfunction%28b%29%7B1%3D%3Db%2Ewhich%26%26%28document%2EgetElementById%28%22contextmenu%22%29%2Estyle%2Evisibility%3D%22hidden%22%29%7D%3Be%3D250%2Cg%3Ddocument%2EcreateElement%28%22DIV%22%29%3Bg%2Eid%3D%22contextmenu%22%3Be%7C%7C%28e%3D120%29%3Bg%2Estyle%2Ewidth%3De%2B%22px%22%3B%0Af%3D%27%3Cdiv%20style%3D%22padding%3A4px%3Bmargin%3A2px%3Bopacity%3A0%2E7%3Bleft%3A10px%3Btop%3A%2D4px%3Bborder%2Dstyle%3Adouble%3Bborder%2Dwidth%3A15px%3B%22%3E%5C%0A%3Cfont%20color%3D%22%23565656%22%20size%3D%22%2D2%22%3ERight%20Click%20Menu%20by%20%3Ca%20href%3D%22http%3A%2F%2Fwww%2Ewhak%2Ecom%22%20target%3D%22_top%22%20title%3D%22WHAK%20it%22%20alt%3D%22WHAK%22%3EWHAK%3C%2Fa%3E%21%3C%2Ffont%3E%3Cbr%3E%5C%0A%3Cu%20style%3D%22color%3Ablue%3Bcursor%3Ahand%22%20title%3D%22Reload%20Page%22%20onclick%3D%22window%2Elocation%2Ereload%28%29%3B%22%3ERefresh%3C%2Fu%3E%3Cbr%3E%5C%0A%3Cu%20style%3D%22color%3Ablue%3Bcursor%3Ahand%22%20title%3D%22Go%20Back%22%20onclick%3D%22history%2Ego%28%2D1%29%3B%22%3EBack%3C%2Fu%3E%3Cbr%3E%5C%0A%3Cu%20style%3D%22color%3Ablue%3Bcursor%3Ahand%22%20title%3D%22Go%20Forward%22%20onclick%3D%22history%2Ego%281%29%3B%22%3EForward%3C%2Fu%3E%3Cbr%3E%5C%0A%3Cu%20style%3D%22color%3Ablue%3Bcursor%3Ahand%22%20title%3D%22Back%20to%20top%22%20onclick%3D%22window%2Escroll%280%2C0%29%3B%22%3ETop%20of%20page%3C%2Fu%3E%3Cbr%3E%5C%0A%3Cu%20style%3D%22color%3Ablue%3Bcursor%3Ahand%22%20title%3D%22Bottom%22%20onclick%3D%22window%2EscrollTo%280%2Cdocument%2Ebody%2EscrollHeight%29%3B%22%3EBottom%20of%20page%3C%2Fu%3E%3Cbr%3E%5C%0A%3Ca%20href%3D%22http%3A%2F%2Fwww%2Emake%2Dgifs%2Ecom%22%20title%3D%22Make%20animated%20GIFs%20online%22%20alt%3D%22Animated%20GIF%20Maker%22%20target%3D%22_blank%22%3EMake%2DGIFs%2Ecom%3C%2Fa%3E%3Cbr%3E%5C%0A%3Ca%20href%3D%22http%3A%2F%2Fwww%2Emake%2Da%2Dmeme%2Ecom%22%20title%3D%22Make%20memes%20online%22%20alt%3D%22Meme%20Maker%22%20target%3D%22_blank%22%3EMake%2DA%2DMeme%2Ecom%3C%2Fa%3E%3Cbr%3E%5C%0A%3C%2Fdiv%3E%27%3Bg%2EinnerHTML%3Df%3Bg%2Estyle%2Eposition%3D%22absolute%22%3Bg%2Estyle%2Eleft%3D%220px%22%3Bg%2Estyle%2Etop%3D%220px%22%3Bg%2Estyle%2Evisibility%3D%22hidden%22%3Bg%2Estyle%2Eoverflow%3D%22hidden%22%3Bg%2Estyle%2Epadding%3D%224px%22%3Bg%2Estyle%2EbackgroundColor%3D%22%23ffffff%22%3Bg%2Estyle%2Eborder%3D%221px%20solid%20%236a6868%22%3Bdocument%2Ebody%2EappendChild%28g%29%3Bdelete%20g%3B%0A%3C%2Fscript%3E%3Ch1%3EBOTTOM%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E