Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

Changing Default Editor for Web Pages

  • I am changing browsers from firefox to Opera. In firefox I was able to specify the editor of my choice as the default editor on web page source code. How do I set the default editor in Opera? Without this I won't be able to use Opera for my making web pages.

  • Note sure. If you search for solutions for Chrome, it's highly likely they'll work in Opera too.

    I think it'd require an extension and an installation of a program on your computer that the extension can pass messages to to tell the program to open the editor you want and load the local html file you're working on. Chromium is kind of picky security-wise with this stuff.

    @stacey21 said in Changing Default Editor for Web Pages:

    Without this I won't be able to use Opera for my making web pages.

    Have you tried ctrl + shift + i to open the developer tools? Switch to the Elements tab and then you can right-click on any element (body or html for example) and edit the HTML. that might not help for saving changes to a local web page source though.

  • Have you tried using Notepad++ to edit the files and then adding a "Launch in Opera" menu item and shortcut for when you want to preview the web page?

       <Command name="Launch in Opera" Ctrl="no" Alt="no" Shift="no" Key="0">&quot;C:\Program Files\Opera\launcher.exe&quot; &quot;$(FULL_CURRENT_PATH)&quot;</Command>
    

    You just close down Notepad++, edit shortcuts.xml in "C:\Users\yourusername\AppData\Roaming\Notepad++" with Notepad that comes with Windows and add that to UserDefinedCommands. You modify the ctrl and or alt and or shift attributes and the key attribute to set what shortcut you want for the command. Either way, "Launch in Opera" will be available in the "Run" menu in Notepad++.

    Doing things that way, you're opening the file in the editor first and then viewing, as opposed to Opening it in Opera to view ait and then telling Opera to open it in an editor.

  • @burnout426
    Thank you for the suggestion though I'm not sure I understand it. Are you saying that Notepad will somehow open the file and connect to Opera, so that changes made in Notepad will be reflected (with refresh) in Opera? Where is "UserDefinedCommands"? And I don't see "Roaming" in AppData folder.

    In any case, Notepad is not the editor I want for this. I use Kedit for all of my editing, including web pages in FF. Kedit is very powerful and has a Profile Exec that runs when the file is opened but I don't know how it would establish the connection to Opera. Perhaps I'll see if Kedit support can help.

    Separately, can someone tell me how to get my forum reply (and topic opening) on the whole screen as I'm writing it? What's available to me to write in is only the bottom third of the screen.

  • @stacey21 said in Changing Default Editor for Web Pages:

    Separately, can someone tell me how to get my forum reply (and topic opening) on the whole screen as I'm writing it? What's available to me to write in is only the bottom third of the screen.

    This is how the forum works as far as I know. There's no setting to change it

  • @stacey21 said in Changing Default Editor for Web Pages:

    I use Kedit

    This one https://www.kedit.com/?

    If so, in the command window in Kedit, you can do:

    winexec "C:\Program Files\Opera\launcher.exe" tester.txt
    

    where "tester.txt" is the current file loaded. save tester.txt was used to create the file and it was saved in my documents folder. I was able to pass "tester.txt" to launcher.exe without specifying the full path. But, maybe the winexec command supports a currentfilepath variable or something.

  • @burnout426 said in Changing Default Editor for Web Pages:

    winexec "C:\Program Files\Opera\launcher.exe"

    Yes...that's Kedit. I used your sample (specifying the full path) and the text file opened in Opera. But I'm not clear on what's been accomplished. The editor that opened in Opera is not Kedit and I can't do editing there. I also don't have the html file open in Opera. To make a change I still have to start in native Kedit, make the change. Then I have to get Opera to open the HTML version of the txt file, which it hadn't done to see the affect of the change. Then I think I have to re-save the txt file as html.

    I have to think about this...

    Thanks for your help. I really appreciate your trying that and showing it to me. By the way, are you a Kedit user also?

  • @stacey21 said in Changing Default Editor for Web Pages:

    By the way, are you a Kedit user also?

    No. I used Notepad++. Never heard of Kedit until you mentioned it.

    @stacey21 said in Changing Default Editor for Web Pages:

    But I'm not clear on what's been accomplished. The editor that opened in Opera is not Kedit and I can't do editing there. I also don't have the html file open in Opera. To make a change I still have to start in native Kedit, make the change. Then I have to get Opera to open the HTML version of the txt file, which it hadn't done to see the affect of the change. Then I think I have to re-save the txt file as html.

    If your're composing a web page in Kedit, you should be editing the html file directly. You shouldn't be editing a .txt file and then saving a copy as .html or renaming the .txt file to .html after you're done editing.

    From your original post, you wanted to open the html file in Opera, change the default source editor to Kedit and then view source of the page (view ctrl + u) and edit it in Kedit. Then, you'd save your changes in Kedit and refresh the page in Opera to see the changes. Since changing the source editor doesn't seem to be supported, what I'm suggesting is to do it the other way around and just edit the page in Kedit directly and then preview it in Opera via double-left-clicking on the html file in Windows or using some Kedit command to launch the current html file you're editing in Opera. It'd be easier to just double-left-click the .html file in the folder you're working in though.

    So, for example, I'd do this in Notepad++.

    • Open a new tab to create a new file.

    • Type my html markup.

    • Save the page as test.html.

    • Double-left-click on the .html file in explorer to launch it in Opera or use "Launch in Opera" right from Notepad++'s menu.

    Then, if I edit the markup again in test.html (which would still be open in Notepad++), I'd hit ctrl + s to save my changes, switch to Opera (where test.html is still open) and reload the page to see the changes.

    Or, if test.html already exists and it's not already open in Notepad++, I right-click on it in Explorer and chose "Edit in Notepad++". Then, I make my changes and open the .html file in Opera.

    If you like keyboard shortcuts, you can switch between Notepad++ and Opera with alt + tab. You can switch between tabs in Opera with ctrl + tab and ctrl + shift + tab. You can refresh a page with F5 for example.

    For Kedit, I'm just not sure how to create a macro or something to open the current file in Opera so you don't have to double-left-click it in Explorer. You can use the Winexec command, but it looks like that might require you to specify the filename, which would be no good for a macro.

    Now, in Opera's developer tools, when you ctrl + shift + i, goto the Elements tab, right-click on an element and choose "edit html", you can edit the markup. Then, you can switch back to the page, ctrl + s to save, choose "webpage only", point it to the html file, save and replace. That way will work as using an editor in Opera. But, there are some downsides. The Elements tab is showing a live DOM view of the page and not the original source. And, if you edit a script in the page, it's not automatically reevaluated and you have to do some override stuff to get the changes and be able to save them. So, using the developer tools to edit sources files isn't that fun.

    Maybe you can find an extension at https://chrome.google.com/webstore/search/html editor?_category=extensions that'll do what you want.

  • @burnout426
    Thank you for your lengthy and detailed explanation of how to do this.

  • @stacey21
    This closed my reply without warning or indication.

    I asked this of Kedit support and he sent me Opera documentation on how to change the editor. However, I can't find the locations shown in the Opera doc in the Opera Setting>Preferences>Advanced screen:
    Opera doc:
    "in the Source Viewer section of this page https://help.opera.com/en/presto/advanced-features/ it says “If you prefer to use an external program for source viewing and editing, you can specify it in the programs preferences.”

    That Opera page points to this page: https://help.opera.com/en/presto/browser-behavior/#programs
    This Opera page says "
    Use other programs for certain actions
    Preferences > Advanced > Programs
    Choose which programs Opera should use to handle specific protocols."

    It then says:
    "Preferences tabs
    The Preferences dialog has 5 tabs (note that the Advanced tab is split into distinct sub-topics):
    Advanced: Programs topic
    Use other programs for certain actions
    Source viewer

    But the Advanced dialog does NOT have "Use other Programs for certain actions" nor "Source Viewer"
    I don't understand how Opera can be contradicting its own doc pages and pointing to non-existent tabs and sub-topics.

    This would be the simple resolution to my issue if the Opera doc pointers and references made sense. Can you help me figure this out?

  • @stacey21 Those are old help pages for the old Opera 12 browser suite that was discontinued years ago.

    Since Opera is based on Chromium, you'll want to look at Chrome and Chromium help pages on the net to find a solution if there is one.

    Or, look at https://help.opera.com/en/latest/ (notice the "latest" in the URL).