Force Firefox to reuse existing tab for modified HTML file - firefox

If Firefox is already displaying a local HTML file on my PC in a tab (address = "file:///...") and I modify the file using my favorite external editor, sending the file to FF to display the edits results in FF opening a new tab with a fresh instance of the original file, rather than searching to see if the file is already open it it and reusing that tab.
Sure, after editing the file I could reopen Firefox, navigate along the tab bar to the existing tab for that file and click Refresh. But IMO FF should be capable of doing this for me. In my work, by the time I need to refresh FF, the tab currently open is not likely to be that of the file I am editing, so I continually need to return to the original page to refresh it.
My efforts to work around this include:
1)In about:config, *setting browser.link.open_newwindow* from 3 to 1.
2)Running Firefox and passing it either the filename or the URL to the filename (as -url parameter).
3)Looking for a suitable add-on.
I am not fond of either Firebug or Aurora and prefer my own editor (EditPlus), which with I am far more comfortable, to edit web pages. However, its inbuilt browser does not display properly on my screen, so I need to view results of edits in Firefox.
Can anyone suggest a solution to this problem? I've searched here without success. The best solution would be another about:config setting. Thanks in advance.
(added) After all, in EditPlus, if I send it a file (in document-centric mode) which it has already opened, it simply changes focus to the existing tab. Why can't FF do this?

Thanks for suggesting the "Restore Open_External" add-on.
I tried it but it doesn't help me here. What it does is:
(quote)
"browser.link.open_external (Integer). This option specifies how Firefox opens links launched externally, e.g. e-mail or Microsoft Word. 3 options are available;
1. Selecting this option launches the link in a new tab in the most recently active Firefox window. This would be recommended if you don’t wish launching such links to affect your most recently active webpage and you aren’t concerned about the links content.
2. Selecting this option launches a new Firefox window to view the link. This would perhaps be the safest option to select (In that if you launch something questionable you may be able to end the process without affecting other windows).
3. Selecting this option (default) launches the link in the most recently active Firefox window/tab. This would be recommended if you aren’t concerned about launching links is the most recently active window/tab (You can always use the back button to view the previous page if you need)."
TechSpot - Firefox 2 Tweak Guide
I'm sure many find this useful. Option 1 would have been fine for my purposes if it didn't insist on opening a duplicate tab. This add-on does nothing to prevent duplicate tabs being opened. So I began hunting for some add-on that might PREVENT a new tab being created in response to an external app sending a file to Firefox. Tab Mix Plus is supposed to do this, but I got lost somewhere in the maze of options. Then there is Prevent Duplicate Tabs, which creates a whitelist of all pages where duplicates are not permitted. This is far from automatic and seems pretty lame to me, as is Duplicate Tab Closer which doesn't prevent a duplicate tab from being created; instead, you have to press Ctrl+Alt+D to remove existing duplicate tabs - equally lame. deduplicate-tabs is similar, but offers a button to remove duplicate tabs.
Maybe I'm missing the point, but I can't see why anyone would want duplicate tabs of the same page, one a later version than the other. In fact, FF ought to be able to automatically refresh a tab when one reselects this, without having to resort to the "refresh" button. But that's just my rant.
If anyone reading this can think of a better way to integrate FF with an external app that modifies a web page, I'll be most grateful.

Install that addon:
https://addons.mozilla.org/en-us/firefox/addon/restore-open_external/
Go to addon preferences and set:
'in the current tab of current window'
Next time you open a new url from an external program it opens in the same tab.

You can also install the
duplicate tabs closer firefox addon which, as the name suggests, allows you to automatically close duplicate tabs
You can configure it to:
Close the older tabs and keep the new tab
Select the new tab

Try this addon.
I'm using it for development mode in Gatsby and Create React App.

Related

Corrupt bookmark: Cannot edit or delete

In Firefox, I have a bookmark I cannot delete or edit.
The bookmark becoming this way is totally my fault: I attempted to install a javascript bookmarklet but managed to save it with "http://" in front of the javascript. Bookmarklets should only start with "javascript:".
Now, the bookmark is forever locked and unusable, with the beginning of the URL like so: "http://javascript:", essentially two protocols being used. Firefox doesn't know how to handle it, so the bookmark edit dialog only half-renders with just Save and Cancel buttons, no other details. Right-click actions on the bookmark do nothing. The only interaction I can do with the bookmark is drag it to another position in my bookmarks bar.
I suspect I need to manually edit my bookmarks to either delete it or make the URL correct.
Perhaps one way of doing this is opening the bookmarks file (place.sqlite) with a database editor.
Any other recommendations?
SOLVED:
Using SQLite Browser, I was able to find the bad bookmark and fix it's URL. On the first try, the URL ended up being "#javascript:" when I re-checked it inside Firefox. Not sure how that # character got there, but I did a 2nd try and this time got a clean "javascript:" URL and the bookmark operates normally: I can edit or delete it.
To anyone trying this, definitely make a copy of your places.sqlite before making changes. The table containing the bookmark URLs is "moz_places" and it the column is just "url".

How to prevent Firefox reloading tabs (even one clicked on)

Seriously, is there any way to tell Firefox NOT to reload tabs after start?
I know I can check "Don't load tabs until selected" in Options window, but this only stops reloading tabs automatically and will still reload tab I click on - I do NOT want that!
I want to reload every tab myself.
The reason is that sometimes I have multiple tabs with Adminers' SQL command textarea which gets cleared on reload. You surely get how happy I am everytime I have to remind the commands.
I tried googling for any extensions or about:config options but nothing do what I want. Am I the only one wanting this?
I submitted the bug here https://bugzilla.mozilla.org/show_bug.cgi?id=900494
I don't think it's possible to disable loading of clicked tabs. But, you can try for instance Work Offline addon that allows you easily switching Firefox to offline mode. Firefox loads clicked tab from its cache in offline mode and it could preserve your textareas.
I know I'm late to the party, but I just had this issue myself and perhaps this answer will help other users. I went into about:config and searched for the setting browser.sessionstore.max_resumed_crashes and changed that from default 1 to 0.
Go to Firefox' about:config (via the address bar), click "accept the risk", then type accessibility.blockautorefresh in the search bar and toggle that setting to true.
Edit: restart of FF is necessary.

Unable to set breakpoints in Chrome dev tools, version 26.0.1410.64 m

I need to debug some JavaScript an' I use Chrome dev tools. I'm a newby in JavaScript (just started to learn a couple of days ago), an' at work I could set breakpoints via the Resources pane. But at home for some reason I can't do this: after the click no breakpoint appeares.
I have Chrome version: 26.0.1410.64 m.
What could be the case?
clicking on the De-Obfuscate Source button (i.e. {}) solved this issue for me.
I'm a fool! haha! breakpoints are set in the Source pane )))
It's been a while, but in version 33.0.1750.146, but my problem was that I was on the Sources pane (I'd call this a tab; it's one of the items at the very top of the window), but I was on the Content scripts tab (on the left hand side). I needed to switch to the Sources tab.
To be clear, there are two sets of Sources tabs; one is within the other.
UPDATE 2016-01-07: Now I'm on 47.0.2526.106. The only thing that worked for me today was to close DevTools and re-open. It was a little finicky. It worked once, then stopped, and I had to close the DevTools and re-open again. I saw #johntrepreneur's answer about closing the browser, but unfortunately I have too many tabs open on too many workspaces, so that's too much of a pain, so I didn't try that, although I have to assume that would work.
Other solutions didn't work for me. Had to close and restart browser to be able to set breakpoints again.
This also happens when there is a JS error in your code.
Some sort of weird built in function in windows 10 i think because I did press a few buttons by accident. Some of my keys even stopped working in certain areas of visual studio. F.e the letter "c" stopped working in the find window.
Mine did this and no solution worked, i pressed alt, windows key and function key a few times and my problem went away.
Fixed as follows: For me, the issue stems from having set up Chrome to interact with operating system files. If you set this up, then the fact is evident from a green dot by the file name. At some point, I could not set a breakpoint in a recently edited file. I fixed this by disconnecting the interaction, as follows: When viewing "sources", above the code, there were some file names listed. Clicking the [x] to make the particular filename go away gave a caution message; I proceeded without saving. After that, I was able to set breakpoints for that file.
I also had this problem. However, once I closed the popup message in my browser, suddenly all my breakpoints that I set in that time appeared. Mental note: Don't set breakpoints while your app is showing a popup.
I couldn't find any direct fix for this problem.
It seems that chrome keeps settings of your site stored somewhere whatever you do to clean it. (I tried removing the folder from workspace, closing et reopening chrome etc... and nothing worked).
A workaround is to change your site's url to make chrome consider it a new site

firefox brand new “new tab page” - how to see/edit blocked/pinned items?

While it's simple to pin/block a link-screenshot in the new beautiful tab page in firefox I see no way to edit the list of blocked/pinned items, does anybody know how to do it?
E.G. I blocked a page but now I woukld like to unlock, how to do it?
Thanks.
This is for FF17 on Windows, Mac/Linux users cf below
To unlock a blocked page quit Firefox, download sqlitebrowser at sourceforge.net (~6MB as of now, Windows only), use it to open chromeappsstore.sqlite in your "Profiles" directory. On Win Vista that's eg:
[DRIVENAME]:\Users\[USERNAME]\AppData\Roaming\Mozilla\
Firefox\Profiles\[ALPHANUMERICSTRING].default\chromeappsstore.sqlite
Switch to the "browse data" tab, open the edit view of the value corresponding to the "pinned links" key (double click on it). Replace one entry (eg a null) with
{"url":"YOUR_URL","title":"YOUR_TITLE"}
apply changes, save changes.
There's a key "blocked links", too. Intuitively, deleting blocked urls from its value should help, but it didn't when I tried. The trick above is clumsy, but so far I couldn't google anything more elegant. I couldn't find anything useful searching Firefox' about:config tab, either. I found this solution when doing a string search for the blocked url in my profiles directory.
Mac/Linux users should find other sqlite browsers. When using the firefox addon SQLite Manager you would need to make a copy of the database file first and edit that. Afterwards quit Firefox and replace the old file with the new one.
Here's the bugzilla entry ("Bug 722234 - [New Tab Page] provide an option to undo remove a site "), status is assigned, not solved. On comment reads: "Currently, there is now way to undo removal of a site or resetting the page using the new layout."
There's an easier way to do it without downloading, especially for people who may not navigate computers very well. Mozilla does have a way to do it, they just label it poorly and it's a bit roundabout.
Make the page you blocked on your new tabs page a Favorite, then click and drag to an empty space on your new tab page and it will autopin. The one downside is that if you unpin it the site will disappear again. I was frustrated for weeks after I removed Google and there doesn't seem to be much help out there that's simple.
"Make the page you blocked on your new tabs page a Favorite"
What does that mean? Bookmark?
I clicked the PIN icon on a couple and instead of pinning it, it seemed to completely remove that page from the New Tab selections altogether...and indeed, I see no way to get it back. Why would pinning something take it away!? And they were pages I use many times every day; very disappointed.
And those that I clicked ARE in my bookmarks ('Favorites' is an IE term), but they have not reappeared as suggested above.
The sqlitebrowser approach above is too complex and I can see it going awry trying to get all that right. Sad day here for me.

How can I make the tabs work normally on Xcode 4?

Xcode finally added tabs but the problem is that they behave very strange. For example they will keep a tab open only if it was opened to a new tab.
If you open a file just by clicking in the project tree, Xcode will close your tab as soon as you are clicking on another file in the tree.
Is is possible to make them behave like real tabs and prevent Xcode from reusing them? How?
I use a method similar to franks:
In Preferences > Navigation (or Preferences > General in versions of Xcode prior to 5) you can set Optional Navigation to Uses Separate Tab
Now opt-clicking a file in the file navigator will open it in a new tab
Better yet, opt-clicking links in the code opens the destination file in a new tab
The big feature missing is swapping to an already open tab containing the file if there is one (or staying in the current one).
UPDATE for 2020:
Finally, almost 10 years later, Xcode 12.x now appears to mostly resolve the issue described here. There is a new Navigation Style option in the Navigation settings panel that controls this behavior.
The behavior has some new quirks/design-choices that seem to make sense, but I'm still getting used to the new experience. For example, a tab will get re-used unless the file in that tab has been edited recently; such a tab is indicated with an italics title.
PREVIOUS ANSWER
I don't think you can currently get the behavior you desire (or I desire). While the tabs work like Safari, they don't work like tabs in other popular IDEs (Visual Studio or Eclipse). And for me this kind of sucks.
In general, I expect IDE tabs to keep more than 1 file open. So if I click a file in the project tree, I expect that it will switch to the tab I have opened with that file - if I have already opened it. Instead, XCode 4 changes the current tab to the file I clicked - making 2 tabs with the same file. Having 2 tabs with the same file is fairly useless.
This forces the user to scan the tab bar first to see if the file is currently opened; if it's not opened then you can look to the project tree. But if you click in the project tree first (which is what I tend to do) then you get punished because you will have just killed a tab.
This isn't really an answer insofar as it contains a solution; I mostly just want to join in the griping. But upvoting will make you feel better and prove Apple wrong. :)
The problem with Xcode 4's implementation of tabs is that Apple has implemented them as workspace tabs. In other words, creating a new tab essentially creates a new workspace, each with its own sub-panes with their configurations, etc. It's essentially a whole environment in each tab. There are a number of problems with this choice.
This differs from most IDE/text editors' implementation of file tabs wherein a tab (generally) represents a single file, and each file has its own tab.
The problem with workspace tabs is there are only so many potential different workspaces we could benefit from, severely limiting the actual use of tabs in this way. Beyond this, the additional workspaces just become a liability, introducing more things the user of the application needs to concern him/herself with: for example, what the navigator view is, what editor mode is active (standard, assistant, version), whether the debug console is open, etc. etc. Suddenly switching to a new tab means you now have to worry about getting the environment back in the form you need it, because there's a good chance the other tab wasn't left in the state you expect to find it in. This actually discourages the use of tabs because it introduces more work in the workflow.
File tabs don't have this problem (not counting special cases like split view panes) because all that's changing is the file you're looking at, not your whole environment. Moreover, if implemented properly, file tabs work great as an immediate history, allowing one to quickly switch back to a file that was worked in recently, with little effort. The only way to do this in Xcode is to explicitly set up a new tab environment for each file you want to work with, but you have to be careful not to change the file in that tab or your file all of a sudden becomes lost: again, more work for the user.
Workspace tabs are also significantly heavier-weight than file tabs, because there is much more to remember and switching workspaces involves much more than switching files.
The truth is (and I think most will agree with me on this), to a developer, file tabs are much more useful than workspace tabs, and as it stands Xcode still lacks a proper implementation of this feature that many would consider basic required functionality in an IDE/editor.
Xcode->Preferences->General->Double Click Navigation and from the list, choose Uses Separate Tab.
Well, not a real answer but my personal workaround. The real problem for me is, that a file opened in a tab goes away so easily in xcode 4. Finding a file again can be time-consuming, so I like them to be in a tab and stay there.
I solved this (somehow) for me by exactly identifying the actions I do which cause the tab to switch to another file and replace them by their equivalent actions which open a new tab instead.
Instead of single-clicking a file in the navigator, I always double-click which I have set to open a new tab
Most time I do not use the navigator, as it has a different state of opened and closed folders in each tab. Not useful for me. So I switched to using Option ⌥ Command ⌘ O. When opening a file from this list I keep ShiftOption ⌥ pressed. In the small window appearing I choose 'new tab'.
When clicking on links in code I press ShiftOption ⌥ Command ⌘, too, and open in new tab.
I keep two fixed tabs around for editing target-related settings and to view build results. I completely disabled all automatic tab switching in the prefs, because I noticed this distracted me to much.
I would really love to get something like the xcode 3 favorites bar in xcode 4, this was so simple to use..
I imagine my answer won't bubble up for a while, but if you want this to work like visual studio or intellij (or at least closer)
Preferences->General->Double Click Navigation->Uses a separate tab
Double Clicking a file now will stop opening it in a new window and open it in a new tab.
Single is still dumb and takes over your tab. But if you get used to double clicking (which I was already) this will save you some headaches. I suppose.
I absolutely hate how tabs work in Xcode. However, the only workaround i found that works decent is using the OSX tabs shortcuts:
CTRL + CMD + ->
CTRL + CMD + <-
I found my way in Preferences-Behaviors!
I hated Xcode 4 first for the tab issues discussed here, mainly because the debug information kept opening new files in tabs and changing the navigator
in Behaviors you can define a Debug tab and make the Run and Build jump there in various ways. in the Debug tab I give more space to navigators left and bottom
for similar reasons I have a Find tab, too
the other tabs are for files I am writing in. I start them with the .h which is usually small enough so I need only one view, and then with single clicks in the navegator I open 2-3 versions of the .cpp file so I can set them to the locations where the recent hot spots in the file are. then I close the navigators in those tabs
this does not invalidate the care and tricks given in the other answers here, but makes them far less hard
happy coding!
I found out that when pressing option a.k.a. alt when opening files in the navigator, you will jump to the tab already open with the file and a new tab will open in case it was not yet open.
This technique also works when opening files via cmdshift-O and opening the suggestion with option-enter in stead of simply enter...
Now, if there would be some way to make this the default, i.e. the need to keep pressing option all the time would be removed, that would be a big step forward.
Also I use Behaviors to keep my tabs from being recycled after test or build failures.
(Like other people, I totally mislike Xcode's tab behavior. Apple should take a look at IntelliJ...)
xcode tab bar is so suck, I think Apple should enhance the feature of the tab navigation to avoid followed 3 points.
1. double click a file will let xcode open another tab if it has already been there.
2. for more tabs, the tab will become small and thus I don't know which file in which tab, I want the tab show full name
3. for even more tabs, new tabs will be hidden, instead of two lines of tabs. I want to it show two lines of tab bars.
If you have the tab bar enabled (View/Show Tab Bar) and you double click a file, it appears in it's own window, with a single tab (Be sure the Tab Bar is enabled in both the new and old (main) windows).
Now all you have to do is drag that new window from its tab and drop it into the tab bar of your main window.
It will stay docked as a separate tab, showing that file.
To change the file open in that new tab, go Project / Reveal in Project Navigator, which opens the project navigator at the left hand side.
Tabs in Xcode 4 work like tabs elsewhere on Mac OS X, for example in Safari and Terminal.

Resources