Posts

Showing posts from March, 2024

Referrer Filter and CSRF Filter

            In Adobe Experience Manager (AEM), both the Referrer Filter and CSRF (Cross-Site Request Forgery) Filter are security mechanisms designed to protect against different types of web vulnerabilities. While they serve related security purposes, they operate based on different principles. Let's take a closer look at each. Referrer Filter The Referrer Filter in AEM is used to restrict HTTP requests based on the value of the HTTP Referer header (the misspelling of "referrer" is historical and comes from the original HTTP specification). This header indicates the URL of the webpage that linked to the resource being requested. The purpose of the Referrer Filter is to ensure that only requests originating from trusted domains are accepted by the AEM server. This is a security measure to prevent unauthorized API calls, resource access, or other actions that might be part of a CSRF attack or other malicious activities. Configuration of the Referrer Fi...

Javascript Event Propagation (Bubbling and Capturing)

Image
                                 Event propagation is a mechanism in the Document Object Model (DOM) that determines how events propagate or travel through the DOM tree when an event occurs. This mechanism consists of two phases: capturing (or capture phase) and bubbling. Understanding event propagation is crucial for effective event handling in web applications, as it influences how events are detected and managed across nested elements. Capturing Phase (Event Capture) . The capturing phase is the first phase of event propagation. When an event occurs, it is first captured down from the root of the document to the target element. This means that the event starts from the topmost parent element in the DOM tree and travels down to the target element, triggering event listeners registered for the capture phase along its path. . The capturing phase allows developers to handle an event befor...

Javascript Event Handling

Image
                 Event handling is a fundamental aspect of web development that allows JavaScript to respond to user actions or other occurrences within the web page. An "event" can be anything from a simple mouse click, keyboard press, webpage loading, form submission, to more complex triggers like animation completions or data fetching. Event handling enables web pages to be dynamic and interactive, reacting to user inputs in real time. Key Concepts of Event Handling 1. Events : Events are actions or occurrences that happen in the system you are programming, which the system tells you about so your code can respond to them. For web pages, these are mostly user actions or browser-triggered signals. 2. Event Listeners (or Handlers) : An event listener is a procedure in JavaScript that waits for an event to occur. You attach listeners to elements you wish to monitor for events. When the specified event happens, the listener detects it and...

Window Object in Java Script

Image
               The window object represents an open window in a browser. If a document (web page) is inside a frame or iframe, the document's window is a different object than the one returned by window.parent or window.top (used to refer to the topmost window). In the context of a web browser, the window object is implemented by the browser itself and serves as the global execution environment for JavaScript code. This means that globally declared JavaScript variables and functions are properties of the window object. Key Features and Properties 1. Global Scope : It acts as the global scope for JavaScript executed in the browser, meaning any global variable or function is a property of the window object. This allows for easy access to and modification of global variables across different scripts. 2. DOM Access : Through the window.document property, it provides direct access to the Document Object Model (DOM) of the page, which repre...