adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.29k stars 7.66k forks source link

Live Preview MultiBrowser does not launch browser on Linux #10229

Closed jatin7gupta closed 9 years ago

jatin7gupta commented 9 years ago

i did what ever was written in the text, but it didn't open in mozilla firefox beta version

ekaradon commented 9 years ago

Same here. I am working with Firefox (34.0.5) on a Archlinux 64bits system up-to-date and on a KDE environment. I do not get any error. The thunderbolt stay half-highlighted, see below: snapshot105 I tried both with and without extensions. It does not work anyway. I tried to get logs of error by starting it from shell, but it did not output anything.

busykai commented 9 years ago

@jatin7gupta, this is unfortunate it did not work for you. Are you on Linux? When you say it does not open the page, what exactly does not work? Is the browser not launched? Could you please provide the output you see in the Developer Tools console (use Debug -> Show developer tools to open it)?

busykai commented 9 years ago

@ekaradon, it would be very helpful to understand the cause if you provided the output on the developer console. I see you have debug.showErrorsInStatusBar on, could you please set it to false, reload Brackets and then use Debug -> Show developer tools to see the console and copy output from it?

ekaradon commented 9 years ago

@busykai, here my logs:

ownload the React DevTools for a better development experience: http://fb.me/react-devtools /thirdparty/react.js:4356
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.
    at Object.defineProperty.get (/brackets.js:120:32)
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:4:3) /utils/DeprecationWarning.js:88
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.
    at Object.defineProperty.get (/brackets.js:120:32)
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:656:5) /utils/DeprecationWarning.js:88
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.
    at Object.defineProperty.get (/brackets.js:120:32)
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:656:17) /utils/DeprecationWarning.js:88
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.
    at Object.defineProperty.get (/brackets.js:120:32)
    at file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:47:18
    at Function.CodeMirror.getMode (/thirdparty/CodeMirror2/lib/codemirror.js:4615:19)
    at file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:614:27
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:656:4) /utils/DeprecationWarning.js:88
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror.
    at Object.defineProperty.get (/brackets.js:120:32)
    at file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:49:5
    at Function.CodeMirror.getMode (/thirdparty/CodeMirror2/lib/codemirror.js:4615:19)
    at file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:614:27
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/jade/main.js:656:4) /utils/DeprecationWarning.js:88
getPreferenceStorage is called with client ID '/home/ekaradon/.config/Brackets/extensions/user/brackets-pep8/main.js,' use PreferencesManager.definePreference instead.
    at Object.getPreferenceStorage (/preferences/PreferencesManager.js:126:32)
    at Object.<anonymous> (file:///home/ekaradon/.config/Brackets/extensions/user/brackets-pep8/main.js:46:42) /utils/DeprecationWarning.js:88
Cannot register file extension "html" for Django, it already belongs to HTML /language/LanguageManager.js:632
Cannot register file extension "htm" for Django, it already belongs to HTML /language/LanguageManager.js:632
NodeSocketTransport - start /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
Use WorkspaceManager.createBottomPanel() instead of PanelManager.createBottomPanel().
    at Object.exports.createBottomPanel (/view/PanelManager.js:53:28)
    at file:///home/ekaradon/.config/Brackets/extensions/user/brackets-pep8/main.js:149:38
    at _callHandler (/utils/AppInit.js:93:13)
    at Object._dispatchReady (/utils/AppInit.js:113:13)
    at Object.eval (/brackets.js:290:33)
    at j (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:26860)
    at Object.k.add [as done] (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:27169)
    at Object.d.always (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:28045)
    at Object.eval (/brackets.js:288:30) /utils/DeprecationWarning.js:88
Registering for deprecated event 'currentDocumentChange'. Instead, use MainViewManager.currentFileChange. Error
    at Object.on (/utils/EventDispatcher.js:100:43)
    at file:///home/ekaradon/.config/Brackets/extensions/user/brackets-pep8/main.js:171:12
    at _callHandler (/utils/AppInit.js:93:13)
    at Object._dispatchReady (/utils/AppInit.js:113:13)
    at Object.eval (/brackets.js:290:33)
    at j (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:26860)
    at Object.k.add [as done] (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:27169)
    at Object.d.always (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:28045)
    at Object.eval (/brackets.js:288:30)
    at j (file:///opt/brackets/www/thirdparty/thirdparty.min.js:559:26860) /utils/EventDispatcher.js:100
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.hideHighlight()"},"id":1} /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87

The last line (NodeSocketTransport) is the only one relevant I think... not sure however.

busykai commented 9 years ago

@ekaradon, thank you for the log. I see. It sounds like your browser does not get started. Do you actually see the browser when you start Live Preview? If not, could you please run the following from the command line:

xdg-open http://google.com

Does this start a browser for you? If it does not, try following these instructions to set a default browser.

ekaradon commented 9 years ago

I see the browser, but nothing happens (no new tabs open, no new windows, nothing, ...). When I run your command, it opens google on firefox immediately.

busykai commented 9 years ago

@ekaradon, interesting. i'll have to look more into this. just to clarify: if you close the browser, restart Brackets, then click Live Preview icon (w/o the browser running), the browser gets started, does it?

ekaradon commented 9 years ago

@busykai, I just tried to launch Firefox by just clicking on Live Preview Icon and it did nothing, firefox is not getting launched by Live Preview Icon, even if Firefox is not running.

pixelr0 commented 9 years ago

same here on Ubuntu 15.04

NodeSocketTransport - start /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.hideHighlight()"},"id":1} /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.highlightRule(\"[data-brackets-id='11']\")"},"id":2} /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87

when "livedev.multibrowser": true, i get "Live Preview: Connecting..." but nothing happens.

xdg-open http://google.com works, also Live Preview works fine when "livedev.multibrowser": false

pixelr0 commented 9 years ago

yes, Ubuntu 15.04 (Vivid Vervet) http://cdimage.ubuntu.com/daily-live/current/

Vinnl commented 9 years ago

Same here, Ubuntu 14.04 with Firefox 34 as the default browser.

NodeSocketTransport - start                        /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
...
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.hideHighlight()"},"id":1}                        /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.highlightRule(\"[data-brackets-id='20']\")"},"id":2}                        /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87
NodeSocketTransport - send,,{"method":"Runtime.evaluate","params":{"expression":"_LD.highlightRule(\"[data-brackets-id='2']\")"},"id":3}                        /LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87

xdg-open just works.

busykai commented 9 years ago

Got it reproduced on Ubuntu 14.04. Working on a fix.

busykai commented 9 years ago

There's a workaround. It's a problem with installer/package. Please add exec permission to the following file:

chmod a+x /opt/brackets/www/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/open/vendor/xdg-open
busykai commented 9 years ago

Clarified the title since the original submitter did not respond and the rest is reporting Linux issue.

pixelr0 commented 9 years ago

thanks @busykai

sudo chmod a+x /opt/brackets/www/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/open/vendor/xdg-open

fixed it for me on Ubuntu 15.04 (and yes there is something wrong with the installer)

ekaradon commented 9 years ago

thanks @busykai, it fixes my issue too. :+1:

thediex09 commented 9 years ago

The fix strats firefox, but does not update the page!

busykai commented 9 years ago

@thediex09, could you please file another issue since it sounds like you're hitting different problem now? if you have any errors on console (Debug -> Show Developer Tools), please make sure to include them in the report along with normally needed information.

marcelgerber commented 9 years ago

Fix over at #10267 (was not yet linked).

busykai commented 9 years ago

Thanks @MarcelGerber! I only references the issue from the commit. By the way, it may be an incomplete solution since I'm not sure if the copying/packager preserves the file modes. If not, then a change to post-install script would be needed. Haven't gotten to test it yet, but will do this week.

peterflynn commented 9 years ago

Reopening as FBNC -- we shouldn't close until the adobe/brackets-shell#505 fix has landed in master too.

peterflynn commented 9 years ago

Fix is in master too now.

Rahajustone commented 8 years ago

in ubuntu 15.10 you have to change brackets.json file go to home/.config/Brackets theris a brackets.json file add "livedev.multibrowser":true to the end of file it going to priview in any browsers

YousefYounis commented 6 years ago

Hello, I had same problem on Linuxmint 18, tried pixelr0's solution, but it didn't work directly, there was no such path on my system. So I went to the path where I installed XDK, and tried the previous solution, then restarted XDK, and it worked, the path has change a little. On my system it is:

/home/yousef/intel/XDK/xdk/brackets/b/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn

where "/home/yousef/intel" is where I installed XDK finally I restarted XDK, and it worked :)