This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237296 - Unable to disable saving changes from Chrome Dev Tools
Summary: Unable to disable saving changes from Chrome Dev Tools
Status: VERIFIED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords: 8.0_WAIVER_APPROVED
Depends on:
Blocks:
 
Reported: 2013-10-18 08:23 UTC by b_garcia
Modified: 2014-07-09 01:42 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description b_garcia 2013-10-18 08:23:37 UTC
Hi.

I recently downloaded Netbeans 7.4 and I really liked the Chrome integration but right now I want to disable the autosave functionality of Netbeans with Chrome Dev Tools for css and js modifications.

Sometimes it's cool to have that option enabled but not always... it would be nice to have an option to disable that in the options menu for example.


Is there a way to manage this chrome dev tools integration already?
Comment 1 Jiri Prox 2013-10-18 11:36:40 UTC
Please don't update Target Milestone value, it is developer's task.
Comment 2 Vladimir Riha 2013-10-29 08:54:06 UTC
You can change it if you right click on project, select properties->run and there are checkboxes for Auto-refresh. Does this help?
Comment 3 b_garcia 2013-10-29 09:15:32 UTC
Hi Vladimir Riha, thanks for your answer. 

I suppose you're talking about the "Deploy on Save" option, but that is not the solution for my problem. I want to have "deploy on save" feature turned on so that my changes on Netbeans get automatically applied to my actual deploy without the need of a manual re-deploy. All I'll need to do is refresh my page and my modifications are there.

What I want is a little bit different.

Right now, if I use Chrome as my browser, every modification I do on Chrome Dev Tools Elements or Sources panel gets automatically saved to my project. I don't Want this feature all the time because there are times where I'm just trying some styles or js code on the browser and I don't want it to be saved to my local project. This is particular important on CSS, because I always adjusting things on Elements Panel (Styles subPanel) and I don't want the changes to be saved all the time...


Cump's
Comment 4 Vladimir Riha 2013-10-29 09:21:09 UTC
I see, thanks for clarification. I'm afraid this is not possible now. I've changed the title to be more clear.
Comment 5 Jan Stola 2014-02-13 16:49:07 UTC
I agree that the current behaviour is unexpected (and therefore annoying) sometimes. For example, the saving of changes works even when the page is opened using plain Chrome (not Chrome with NetBeans Connector).
Comment 6 David Konecny 2014-02-18 03:25:46 UTC
Yeah, such option is currently missing. 

b_garcia, if we add this option how frequently do you think you would be changing it? Is this a case that you would simply disable this feature globally for all projects? Or would you like to control it on per peroject basis? Would you also need to switch it on/off regularly during daily development?

I would like to understand first how the option would be used and then decide where to put the option - for example, into IDE global settings; or into project settings in IDE; or into browser integration itself making it available directly in DevTools or Chrome. There is many options.

I personally do not this this is a stopper for NB8 - more of a feature enhancement request.
Comment 7 oxigenio 2014-02-18 08:59:44 UTC
(In reply to David Konecny from comment #6)
> Yeah, such option is currently missing. 
> 
> b_garcia, if we add this option how frequently do you think you would be
> changing it? Is this a case that you would simply disable this feature
> globally for all projects? Or would you like to control it on per peroject
> basis? Would you also need to switch it on/off regularly during daily
> development?
> 
> I would like to understand first how the option would be used and then
> decide where to put the option - for example, into IDE global settings; or
> into project settings in IDE; or into browser integration itself making it
> available directly in DevTools or Chrome. There is many options.
> 
> I personally do not this this is a stopper for NB8 - more of a feature
> enhancement request.

Hi again and thank you all for your answers. 

As a developer and UX guy, I think the right place to put it would be on project settings or directly in DevTools (that would be amazing).

But I would understand (based on the number of people which would use this feature) if this functionality become only availably on global settings or even on a properties file that we could "hack" and update based on our needs.
Comment 8 tonyrvd 2014-06-03 23:10:33 UTC
I am getting this with mac os X mavericks and netbeans 8.0. Even with the refresh turned off in in "run" under projects.  I am disabling the netbeans extension in chrome as a workaround for now. Def producing some unexpected behavior.
Comment 9 David Konecny 2014-07-07 02:51:31 UTC
> As a developer and UX guy, I think the right place to put it would be on
> project settings or directly in DevTools (that would be amazing).

Putting it directly into DevTools might be actually the easiest choice: a new CDT panel called "NetBeans" with a single checkbox named liked "Propagate changes done in the CDT back to the NetBeans IDE and save them".

Let me know if you want a help Tomas with this one.
Comment 10 Tomas Mysik 2014-07-07 05:09:49 UTC
(In reply to David Konecny from comment #9)
> Let me know if you want a help Tomas with this one.

Yes, please. Where can I find this functionality? The best how to fix this issue?

Thanks.
Comment 11 David Konecny 2014-07-07 05:41:58 UTC
Look at extbrowser.chrome/plugins/chrome/js/devtools.js which listens on CDT changes and fires 'onResourceContentCommitted' on which common.js listens and triggers NetBeans.sendResourceChangedInCDT(...).

I think that all what needs to be done is to add some UI to CDT, that is another tab. And that should be doable via extbrowser.chrome/plugins/chrome/html/devtools.html More details at https://developer.chrome.com/extensions/devtools
Comment 12 Tomas Mysik 2014-07-07 05:49:06 UTC
(In reply to David Konecny from comment #11)
> Look at extbrowser.chrome/plugins/chrome/js/devtools.js which listens on CDT
> changes and fires 'onResourceContentCommitted' on which common.js listens
> and triggers NetBeans.sendResourceChangedInCDT(...).
> 
> I think that all what needs to be done is to add some UI to CDT, that is
> another tab. And that should be doable via
> extbrowser.chrome/plugins/chrome/html/devtools.html More details at
> https://developer.chrome.com/extensions/devtools

Thanks, will look at it.
Comment 13 Tomas Mysik 2014-07-07 09:19:54 UTC
Just curious - what are the exact steps to reproduce this issue? If I open in CDT any *.js file, the _same_ file as in NetBeans is opened, right? And if I edit and save it, it is saved to the disk so NetBeans just reloads it.

Thanks for clarification.
Comment 14 Vladimir Riha 2014-07-07 09:27:19 UTC
I think that's the issue. One cannot make changes in CDT without modifying the source file in project at the same time. If you are just "playing" with JS/CSS files in CDT, you don't always want these changes in source files. You might want to just reload the page and get the "original" sources.
Comment 15 Tomas Mysik 2014-07-07 09:36:37 UTC
(In reply to Vladimir Riha from comment #14)
> If you are just "playing" with
> JS/CSS files in CDT, you don't always want these changes in source files.

So by "playing" you mean just editing and no saving?
Comment 16 oxigenio 2014-07-07 09:40:40 UTC
By "playing" I mean something as simple as changing a font size or color in CSS to see if something looks better or worse or edit one line in JS to help debugging. It's all about "testing" something temporarily
Comment 17 oxigenio 2014-07-07 09:41:35 UTC
By "playing" I mean something as simple as changing a font size or color in CSS to see if something looks better or worse or edit one line in JS to help debugging. It's all about "testing" something temporarily
Comment 18 Tomas Mysik 2014-07-07 09:45:06 UTC
(In reply to oxigenio from comment #17)
> By "playing" I mean something as simple as changing a font size or color in
> CSS to see if something looks better or worse or edit one line in JS to help
> debugging. It's all about "testing" something temporarily

Do you _save_ (CTRL + s) such change(s) in CDT or not?
Comment 19 oxigenio 2014-07-07 09:51:55 UTC
It depends...  with JS files then Yes, I need to save the file in CDT so that my changes take effect.

With CSS most of the changes I make are on "Elements panel > Styles subTab" so theres no need to "ctrl + S". If I do them on the "sources panel" then I need to click "ctrl + s"
Comment 20 Tomas Mysik 2014-07-07 10:05:13 UTC
(In reply to oxigenio from comment #19)
> It depends...  with JS files then Yes, I need to save the file in CDT so
> that my changes take effect.
> 
> With CSS most of the changes I make are on "Elements panel > Styles subTab"
> so theres no need to "ctrl + S". If I do them on the "sources panel" then I
> need to click "ctrl + s"

As Honza wrote in comment #5 (and it seems to be true even with the "fix" of this issue), I am afraid that the _saved_ changes are (somehow?) propagated to the disk and therefore these changes will appear in NetBeans.
Comment 21 Tomas Mysik 2014-07-07 10:08:18 UTC
Should be "fixed" now. Láďo, please verify it - I have added a log message [1] when the changes from CDT are sent back to NetBeans (depends on the new CDT panel named "NetBeans").

Thanks.
[1] Sending changes from CDT back to NetBeans

http://hg.netbeans.org/web-main/rev/c75f0297de71
Comment 22 Tomas Mysik 2014-07-07 10:10:06 UTC
One note - Honzo/Davide/anyone, please have a look at the fix and let me know if  you find any problem.

Thanks!
Comment 23 oxigenio 2014-07-07 10:14:39 UTC
Thanks guys for your effort. It would be really nice to get the old behavior (Netbeans 7.3 and lower) where CDT changes where not saved.

Let me know if I can be more helpful.

Cump's
Comment 24 Tomas Mysik 2014-07-07 10:39:28 UTC
Sorry, minor bug fixed (the mentioned logging).

Thanks.

http://hg.netbeans.org/web-main/rev/aa07b6652367
Comment 25 David Konecny 2014-07-07 22:14:46 UTC
(In reply to Tomas Mysik from comment #20)
> As Honza wrote in comment #5 (and it seems to be true even with the "fix" of
> this issue), I am afraid that the _saved_ changes are (somehow?) propagated
> to the disk and therefore these changes will appear in NetBeans.

I'm not sure what you mean by this Tomas.

Before your fix what happened is that NetBeans Chrome plugin listened on CDT changes[1] and sent notification of changed files to NetBeans. And for this to work the only condition was that file changed in the CDT can be found in NetBeans in some open project. To test it try this:
* create new HTML5 project using 'Initializr: Bootstrap' template
* run it in Chrome (with or without NB integration) and then open DevTools in chrome
* in DevTools switch to Sources tab and open localhost:8383/HTML5Application/js/main.js and type into it something and save
Open the main.js file in NetBeans and notice that change was propagated to the source code. The same way you can try to change CSS and it should work too.

With your fix in place (thanks for doing that btw!) I'm experiencing few issues:
* the checkbox is always unchecked. Even if I check it and reload CDT later it gets unchecked again. Could we remember the state of the checkbox? Could it also be checked by default?
* even if I check it the changes in the CDT are never propagated to NetBeans

[1] - by CDT changes are meant edit and save of CSS/JS files; and CSS changes done via CDT Style property sheets (which are applied immediately and do not require an explicit 'Save')
Comment 26 Quality Engineering 2014-07-08 02:28:40 UTC
Integrated into 'main-silver', will be available in build *201407080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c75f0297de71
User: Tomas Mysik <tmysik@netbeans.org>
Log: #237296 - Unable to disable saving changes from Chrome Dev Tools
Comment 27 Vladimir Riha 2014-07-08 06:54:10 UTC
David, I tried it and I cannot reproduce it. The checkbox remembers its state and works as expected for me.


Chrome 35
Product Version: NetBeans IDE Dev (Build 201407080001)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-30-generic running on i386; UTF-8; en_US (nb)
Comment 28 Tomas Mysik 2014-07-08 07:02:21 UTC
(In reply to David Konecny from comment #25)
> With your fix in place (thanks for doing that btw!) I'm experiencing few
> issues:
> * the checkbox is always unchecked. Even if I check it and reload CDT later
> it gets unchecked again. Could we remember the state of the checkbox? Could
> it also be checked by default?

The state is CHECKED by default and it is saved in the chrome internal storage - this works for me without any problem. Do you see any error in the console? As I wrote, feel free to look at the patch.

> * even if I check it the changes in the CDT are never propagated to NetBeans

Likely because the state of the checkbox is not persisted, from unknown reason.

I will try it on my PC/Chrome at work and let you know. It would be fine if anyone else could test it as well, of course.

Thanks.
Comment 29 Tomas Mysik 2014-07-08 07:23:05 UTC
(In reply to Tomas Mysik from comment #28)
> I will try it on my PC/Chrome at work and let you know.

Works for me without any problem (Linux, Chrome 35.0.1916.153), closing back as FIXED.
Comment 30 David Konecny 2014-07-09 01:42:31 UTC
It was a Chrome issue. I tried it again and it still did not work but after restarting Chrome it works without a glitch. Sorry for the false alarm.