Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
The webpage example.com has an edit webpage (from which one can edit example.com itself). example.com/index.php?title=עמוד_ראשי&action=edit I want that after I click ALT+Shift+E, I would im...
#2: Post edited
- The webpage example.com has an edit webpage (from which one can edit `example.com` itself).
- ```
- example.com/index.php?title=עמוד_ראשי&action=edit
- ```
- I want that after I click `ALT+Shift+E`, I would immediately be transferred to that edit page.
- ---
- What console command could I run to move myself from example.com to example.com's edit page?
- I didn't figure out a code but I assume that such code would be very similar to this:
- ```javascript
- let domain = window.location.hostname;
- let h1 = document.getElementsByTagName("h1");
- window.addEventListener('keydown', function(event) {
- if (event.altKey && event.shiftKey && event.key === 'e') {
window.location.href === domain?title=h1&action=edit- }
- });
- ```
- The webpage example.com has an edit webpage (from which one can edit `example.com` itself).
- ```
- example.com/index.php?title=עמוד_ראשי&action=edit
- ```
- I want that after I click `ALT+Shift+E`, I would immediately be transferred to that edit page.
- ---
- What console command could I run to move myself from example.com to example.com's edit page?
- I didn't figure out a code but I assume that such code would be very similar to this:
- ```javascript
- let domain = window.location.hostname;
- let h1 = document.getElementsByTagName("h1");
- window.addEventListener('keydown', function(event) {
- if (event.altKey && event.shiftKey && event.key === 'e') {
- window.location.href === "domain?title=h1&action=edit"
- }
- });
- ```
#1: Initial revision
Move to the edit webpage of a webpage via the keyboard with vanilla JavaScript
The webpage example.com has an edit webpage (from which one can edit `example.com` itself). ``` example.com/index.php?title=עמוד_ראשי&action=edit ``` I want that after I click `ALT+Shift+E`, I would immediately be transferred to that edit page. --- What console command could I run to move myself from example.com to example.com's edit page? I didn't figure out a code but I assume that such code would be very similar to this: ```javascript let domain = window.location.hostname; let h1 = document.getElementsByTagName("h1"); window.addEventListener('keydown', function(event) { if (event.altKey && event.shiftKey && event.key === 'e') { window.location.href === domain?title=h1&action=edit } }); ```