blaise-io / live-reload

Browser extension for web devs. Monitors source files on a page and reloads page or source file when a change is detected.
MIT License
60 stars 9 forks source link

not reloading #15

Closed adventmedia closed 4 years ago

adventmedia commented 4 years ago

Live Reload has suddenly stopped working… possibly due to new Chrome version? Chrome Version 80.0.3987.106, MacOS 10.14.6

blaise-io commented 4 years ago

I just released a new Live Reload version, so it’s probably that. I’ll check tomorrow.

On 15 Feb 2020, at 16:43, Andrew Macrae notifications@github.com wrote:

 Live Reload has suddenly stopped working… possibly due to new Chrome version? Chrome Version 80.0.3987.106, MacOS 10.14.6

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

blaise-io commented 4 years ago

Actually I checked just now and it should work, latest stable Chrome and Live Reload, so I need some more information:

Are you using Live Reload 1.8.0?
Can you show your values of the reload form? If possible, can you share the website URL or HTML source?

You may also get some idea what's going wrong by clicking the "background page" link for Live Reload on the chrome://extensions/ page.

1

It should show something like this:

2

adventmedia commented 4 years ago

Thanks for the quick response! Yes, 1.8.0. The url is local to my dev environment, http://alm-ng The console shows logs when I change the rules config, and when I manually reload the page, but nothing when the source updates (angular cli build)

modx-developer commented 4 years ago

the same problem, 1.8, windows 7, chorme last

dont reload

blaise-io commented 4 years ago

@adventmedia @Fr3ddy7 I cannot reproduce the issue. Can you provide the details as requested in https://github.com/blaise-io/live-reload/issues/15#issuecomment-586623209?

Preferably with html source, screenshot or values of the reload rule and the Live Reload log as shown in my last screenshot.

adventmedia commented 4 years ago

_generated_background_page html 2020-02-22 11-48-12

The screen grab shows what I described in my previous message - the console shows logs when I change a setting in the rules config (Reload stylesheets), but nothing when the site builds or rebuilds. Monitored host is http://alm-ng/home

modx-developer commented 4 years ago

Screenshot_2 Screenshot_1

blaise-io commented 4 years ago

@adventmedia you're monitoring .js but you wanted to monitor stylesheets? (typically .css)

@adventmedia and @Fr3ddy7 please post all relevant data:

adventmedia commented 4 years ago

no, in Angular projects the source css (scss) are compiled into a JavaScript file (styles.js) reload rules:

blaise-io commented 4 years ago

@adventmedia can you post a complete devtools log as text that includes polling? if it contains data you don't want to share on the internet you can also send it to blaisekal@gmail.com and I will treat it confidentially.

In your screenshot I cannot see it polling yet, but in your screenshot you also didn't have the * at the end of the host URL (so it would only monitor / not /foo/bar).

adventmedia commented 4 years ago

I don't know what screen shot you're referring to, but this is the current configuration: Update: ALM 2020-03-26 11-57-31 As for the polling, please tell me how to enable or view it.

blaise-io commented 4 years ago

@adventmedia browse to chrome://extensions/, click "background page" for Live Reload, click "Console" (second tab), make sure there's no filter (log level: all levels). Now open a new tab in Chrome with the page where you expect source file URLs to refresh the page. Then after a few seconds copy paste the log from the background page. It should display something like

13 "http://127.0.0.1:3000/" "matches rule" "Reload rule for Live Reload test"
background.js:193 13 "http://127.0.0.1:3000/" "initialize monitoring"
background.js:253 13 "remove webrequests listener"
background.js:183 13 "http://127.0.0.1:3000/" "matches rule" "Reload rule for Live Reload test"
background.js:193 13 "http://127.0.0.1:3000/" "initialize monitoring"
background.js:211 http://127.0.0.1:3000/static/abc/def/style.css SKIP
background.js:587 http://127.0.0.1:3000/static/abc/def/script.js matches /^http://127\.0\.0\.1:3000/.*?\.js$/
background.js:206 http://127.0.0.1:3000/static/abc/def/script.js MATCHED
background.js:211 http://127.0.0.1:3000/pages/frame.html SKIP
background.js:211 http://127.0.0.1:3000/static/abc/def/import.css SKIP
background.js:308 http://127.0.0.1:3000/static/abc/def/script.js not changed
background.js:291 http://127.0.0.1:3000/static/abc/def/script.js change detected
background.js:301 http://127.0.0.1:3000/static/abc/def/script.js reload parent page
adventmedia commented 4 years ago

well, ok, that's what I've been doing, except for "All levels". With "All levels" enabled, here is the result.


background.js:211 https://www.googletagmanager.com/gtag/js?id=UA-7518938-11 SKIP
background.js:587 http://alm-ng/runtime.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/runtime.js MATCHED
background.js:587 http://alm-ng/styles.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/styles.js MATCHED
background.js:587 http://alm-ng/main.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/main.js MATCHED
background.js:587 http://alm-ng/vendor.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/vendor.js MATCHED
background.js:587 http://alm-ng/polyfills.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/polyfills.js MATCHED
background.js:587 http://alm-ng/scripts.js matches /^http://alm-ng/.*?\.js$/
background.js:206 http://alm-ng/scripts.js MATCHED
background.js:308 http://alm-ng/runtime.js not changed
background.js:308 http://alm-ng/main.js not changed
background.js:308 http://alm-ng/polyfills.js not changed
background.js:308 http://alm-ng/scripts.js not changed
background.js:308 http://alm-ng/styles.js not changed
background.js:308 http://alm-ng/vendor.js not changed
background.js:211 http://platform.twitter.com/widgets/follow_button.html?screen_name=ALMacraeAuthor&show_count=false SKIP
background.js:211 http://platform.twitter.com/widgets/follow_button.html?screen_name=ALMacraeAuthor&show_count=false&show_screen_name=false SKIP
background.js:253 147 "remove webrequests listener"
background.js:239 147 "http://alm-ng/runtime.js" "stop file monitoring timer"
background.js:239 147 "http://alm-ng/styles.js" "stop file monitoring timer"
background.js:239 147 "http://alm-ng/main.js" "stop file monitoring timer"
background.js:239 147 "http://alm-ng/vendor.js" "stop file monitoring timer"
background.js:239 147 "http://alm-ng/polyfills.js" "stop file monitoring timer"
background.js:239 147 "http://alm-ng/scripts.js" "stop file monitoring timer"
background.js:183 147 "http://alm-ng/home" "matches rule" "ALM"
background.js:193 147 "http://alm-ng/home" "initialize monitoring"
background.js:183 147 "http://alm-ng/home" "matches rule" "ALM"
background.js:253 147 "remove webrequests listener"
background.js:193 147 "http://alm-ng/home" "initialize monitoring"
background.js:211 https://www.google-analytics.com/analytics.js SKIP```

And that's it. No updates as the code changes.
blaise-io commented 4 years ago

Thanks that’s useful, will have a thorough look tomorrow!

On 26 Mar 2020, at 18:57, Andrew Macrae notifications@github.com wrote:

 well, ok, that's what I've been doing, except for "All levels". With "All levels" enabled, here is the result.

background.js:211 https://www.googletagmanager.com/gtag/js?id=UA-7518938-11 SKIP background.js:587 http://alm-ng/runtime.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/runtime.js MATCHED background.js:587 http://alm-ng/styles.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/styles.js MATCHED background.js:587 http://alm-ng/main.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/main.js MATCHED background.js:587 http://alm-ng/vendor.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/vendor.js MATCHED background.js:587 http://alm-ng/polyfills.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/polyfills.js MATCHED background.js:587 http://alm-ng/scripts.js matches /^http://alm-ng/.*?\.js$/ background.js:206 http://alm-ng/scripts.js MATCHED background.js:308 http://alm-ng/runtime.js not changed background.js:308 http://alm-ng/main.js not changed background.js:308 http://alm-ng/polyfills.js not changed background.js:308 http://alm-ng/scripts.js not changed background.js:308 http://alm-ng/styles.js not changed background.js:308 http://alm-ng/vendor.js not changed background.js:211 http://platform.twitter.com/widgets/follow_button.html?screen_name=ALMacraeAuthor&show_count=false SKIP background.js:211 http://platform.twitter.com/widgets/follow_button.html?screen_name=ALMacraeAuthor&show_count=false&show_screen_name=false SKIP background.js:253 147 "remove webrequests listener" background.js:239 147 "http://alm-ng/runtime.js" "stop file monitoring timer" background.js:239 147 "http://alm-ng/styles.js" "stop file monitoring timer" background.js:239 147 "http://alm-ng/main.js" "stop file monitoring timer" background.js:239 147 "http://alm-ng/vendor.js" "stop file monitoring timer" background.js:239 147 "http://alm-ng/polyfills.js" "stop file monitoring timer" background.js:239 147 "http://alm-ng/scripts.js" "stop file monitoring timer" background.js:183 147 "http://alm-ng/home" "matches rule" "ALM" background.js:193 147 "http://alm-ng/home" "initialize monitoring" background.js:183 147 "http://alm-ng/home" "matches rule" "ALM" background.js:253 147 "remove webrequests listener" background.js:193 147 "http://alm-ng/home" "initialize monitoring" background.js:211 https://www.google-analytics.com/analytics.js SKIP```

And that's it. No updates as the code changes. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

blaise-io commented 4 years ago

@adventmedia I think I found the problem. https://github.com/blaise-io/live-reload/blob/master/app/background.ts#L32 the tab may trigger tabs.onUpdated when a website uses the History API or when an iframe is loaded. Can you confirm you're doing one or both of these?

blaise-io commented 4 years ago

Fixed in 1.8.1, currently awaiting review in Chrome, published for Firefox.

live-reload-1.8.1-chrome.zip

adventmedia commented 4 years ago

I don't believe I'm using the History api, though that may be buried somewhere inside the Angular framework. Only using iframe on one of the two sites I've been working on. No matter. The updated version of LiveReload is working just fine, thank you!

blaise-io commented 4 years ago

Angular's routing uses the History API.

By the way, Angular also has ng serve which should give you auto-reload.

adventmedia commented 4 years ago

indeed. I'm using ng build --watch, because my back end is PHP, so I'm using MAMP to run a local domain from /dist. There are other ways of doing this but it's the one I know.