X
點擊此處開啟此網站的行動版。

技術支援討論區

Firefox opening infinite number of tabs when trying to open .m files from link in UBUNTU

已張貼

I am trying to open a link to a .m (MATLAB) file directly in the Firefox browser (from a local site).

On windows this works fine and when the link is followed a new tab is created with the .m file converted to a HTML page.

On Ubuntu however it seems like Firefox is iterpreting the file as Objective-C source code and when I am trying to use Firefox to open the file (preferences -> applications -> Objective-C source code -> use Firefox) it keeps on repeatedly opening new emtpy tabs. I can set it so that the file is opening in e.g. gedit, but I would like to have the same behavior as on Windows i.e. a new tab with the file converted to HTML format. Is this possible? Is there a Firefox extension that I am missing? I read that you should use preview in firefox, but I don't seem to have that option (I have included a screen)

I am using Firefox Version 65.0 (64-bit)

I am trying to open a link to a .m (MATLAB) file directly in the Firefox browser (from a local site). On windows this works fine and when the link is followed a new tab is created with the .m file converted to a HTML page. On Ubuntu however it seems like Firefox is iterpreting the file as Objective-C source code and when I am trying to use Firefox to open the file (preferences -> applications -> Objective-C source code -> use Firefox) it keeps on repeatedly opening new emtpy tabs. I can set it so that the file is opening in e.g. gedit, but I would like to have the same behavior as on Windows i.e. a new tab with the file converted to HTML format. Is this possible? Is there a Firefox extension that I am missing? I read that you should use preview in firefox, but I don't seem to have that option (I have included a screen) I am using Firefox Version 65.0 (64-bit)
引用

額外的系統細節

應用程式

  • User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

更多資訊

jscher2000
  • Top 10 Contributor
8516 個解決方法 69567 個答案

Yes, this occurs when Firefox can't handle a type of content it has been instructed to send to itself: Firefox repeatedly opens empty tabs or windows after you click on a link.

I don't know the difference between Windows and Linux builds when it comes to MATLAB .m files. Do you notice any difference in extensions between your Firefox and Linux installations that might be relevant?

Yes, this occurs when Firefox can't handle a type of content it has been instructed to send to itself: [[Firefox repeatedly opens empty tabs or windows after you click on a link]]. I don't know the difference between Windows and Linux builds when it comes to MATLAB .m files. Do you notice any difference in extensions between your Firefox and Linux installations that might be relevant?
這篇文章有幫助嗎?
引用
cor-el
  • Top 10 Contributor
  • Moderator
17277 個解決方法 156165 個答案

Do you have the correct fonts installed?

What happens if you change (add) a .html file extension?

You would normally need to use a web server to do conversions or at least make the page behave as an HTML page or there would be a script embedded in the page to use images instead of fonts.

Do you have the correct fonts installed? *https://developer.mozilla.org/Mozilla_MathML_Project/Fonts What happens if you change (add) a .html file extension? You would normally need to use a web server to do conversions or at least make the page behave as an HTML page or there would be a script embedded in the page to use images instead of fonts.
這篇文章有幫助嗎?
引用

提出問題者

Thank you for the replies.I think you are right, on windows I get redirected to a server where the file is stored which is doing the conversion and on my ubuntu machine it tries to download the file localy. I looked in the source code of the site and if I follow the link that is written in the source it seems to work on my ubuntu machine. So maybe there is a java script issue?

Thank you for the replies.I think you are right, on windows I get redirected to a server where the file is stored which is doing the conversion and on my ubuntu machine it tries to download the file localy. I looked in the source code of the site and if I follow the link that is written in the source it seems to work on my ubuntu machine. So maybe there is a java script issue?
這篇文章有幫助嗎?
引用

提出問題者

Hi again,

I have found that if I add "view-source:" before the link like so: view-source:http://x/y.m. It works, is it possible to set in preference that if there is a link to a .m file it opens it in source mode?

Hi again, I have found that if I add "view-source:" before the link like so: view-source:http://x/y.m. It works, is it possible to set in preference that if there is a link to a .m file it opens it in source mode?
這篇文章有幫助嗎?
引用
jscher2000
  • Top 10 Contributor
8516 個解決方法 69567 個答案

Hi user9015897, that's a very resourceful idea. I actually don't know how you could "switch" the protocol from http/https to view-source. Unfortunately, links in web pages can't go to a view-source address (so modifying the link doesn't work).

On Windows, if I execute a command line such as the following, Firefox does accept the view-source: protocol:

"C:\Program Files\Mozilla Firefox\firefox.exe" -url "view-source:https://support.mozilla.org/en-US/questions/1261530#answer-1231296"

I don't know how to translate that for Linux, but as a temporary workaround, perhaps you could create a script that just takes the true URL and creates that kind of command line. ??

It might be possible for an add-on to hook into the Content-Type of .m files the way they hook RSS feeds and grab the file. I haven't looked into how they do that.

Hi user9015897, that's a very resourceful idea. I actually don't know how you could "switch" the protocol from http/https to view-source. Unfortunately, links in web pages can't go to a view-source address (so modifying the link doesn't work). On Windows, if I execute a command line such as the following, Firefox does accept the view-source: protocol: "C:\Program Files\Mozilla Firefox\firefox.exe" -url "view-source:https://support.mozilla.org/en-US/questions/1261530#answer-1231296" I don't know how to translate that for Linux, but as a temporary workaround, perhaps you could create a script that just takes the true URL and creates that kind of command line. ?? It might be possible for an add-on to hook into the Content-Type of .m files the way they hook RSS feeds and grab the file. I haven't looked into how they do that.
這篇文章有幫助嗎?
引用

提出問題者

hi, Thank you for the answer. yes, writing this in the linux terminal works: firefox -url view-source:https://support.mozilla.org/en-US/questions/1261530#answer-1231296 I am currently using Selenium and geckodriver to automate a process where part of that process is to access this link. I'll see if I can use this workaround. Thank you

hi, Thank you for the answer. yes, writing this in the linux terminal works: firefox -url view-source:https://support.mozilla.org/en-US/questions/1261530#answer-1231296 I am currently using Selenium and geckodriver to automate a process where part of that process is to access this link. I'll see if I can use this workaround. Thank you
這篇文章有幫助嗎?
引用
cor-el
  • Top 10 Contributor
  • Moderator
17277 個解決方法 156165 個答案

Doesn't create Selenium create a new profile folder on each start? In that case it would be weird to get multiple tabs opening because only default actions should be available.

Is there a default application for the ".m" file extension?

  • xdg-mime query filetype *.m
Doesn't create Selenium create a new profile folder on each start? In that case it would be weird to get multiple tabs opening because only default actions should be available. Is there a default application for the ".m" file extension? *xdg-mime query filetype *.m
這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題