Visual Studio Code DDEV and auto reload on Linux - linux

I'm using DDEV with Visual Studio Code and I tried to configure Live Server Extension to automatically auto reload page that I'm working on in Chrome when I hit save in VSC, but it doesn't seem to work with PHP.
Is there a way to configure this to work with DDEV?
I can't seam to find any info on this issue.
Thanks

I've managed to do it another way, with guard and guard-liveguard on linux.
The workflow was:
guard installation
guard-livereload installation
Installation was not quite straightforward, but you can follow the instructions in Terminal and install what's missing if it tells you so.
Guard placed Guardfile inside of /home/user directory so I edited it to contain only this, regarding livereload pard:
guard 'livereload' do
watch(%r{.+\.(css|scss|html|php|js)$})
end
Then I installed Liveguard Google Chrome Browser Extension from here:
http://livereload.com/extensions/
Under settings I had to enable "Allow access to file URLs".
Also, you have to press liveguard extension icon in Chrome in order for it to track changes.
That's about it, now when I edit any of the file types entered in Guardfile (you can edit and add what you need, of course) it automatically reloads my Chrome window whit the edited page opened.

Related

Extension downloading freezing at "checking"

My adblock extension was acting buggy, so I uninstalled it. When I went to reinstall it, it got stuck on "Checking". And it never moves past it. Whenever I try to restart the download, it says that I already have it downloading.
I've tried resetting things, I've restarted my browser, signed off of my google account. Everything I can think of and that I've seen suggested.
If anyone reads this, try turning off "Use Hardware Acceleration" in your chrome settings. Use search to find it on settings menu. Fixed the issue on my VM.
There is a discussion in the adblock forum about this issue. I don't know if you have already seen this, but I think it is worth looking at; as there are several suggestions on how to resolve this.
Try the development version.
Change the download location specified in chrome.
Check if you are logged with your users in store.
Hope this helps.
Steps to resolve:
Completely stop Chrome (you'll need to exit Chrome in your task bar even after closing the Chrome window).
Rename your Extension State directory to Extension State.bak.
Restart Chrome.
Below is the path of the Extension State directory on Windows:
C:\Users\<user_name>\AppData\Local\Google\Chrome\User Data\Default\Extension State
See Where does Chrome store extensions? for the Extension State path on other operating systems.

How do I install LiveReload on Sublime Text 3?

I'm using Sublime Text 3 and want to use LiveReload. I have a browser plugin for Chrome already installed. Node.js is also installed.
For Sublime Text 3 Live Reload this plugin must be installed:
https://github.com/dz0ny/LiveReload-sublimetext2
How can I install it on Windows 7? It just says something about Linux and OSX users.
Platform I used: Linux Mint 17+
I want to thank http://anthozano.fr/livereload-pour-sublime-text-3/. I was able to run live reload on sublime text 3 with the instructions in the website. However, the website is written in French (i believe - Google translate said), so I thought I could write the steps here.
First install sublime text 3 from here http://www.sublimetext.com/3 or follow your own way you prefer (I did it with Linux mint Package manager).
Secondly, install package control from here https://packagecontrol.io/installation#st3 (instruction is clearly given in the website so I did not explain it much).
Third, open package control (Shortcut : Ctrl+Shift+P) and search for Package Control: Add Repository
Now comes a region to enter URL at bottom part of sublime text 3 window. Enter https://raw.github.com/Grafikart/ST3-LiveReload/master/package.json.
Again, open package control and search for Package Control: Install Package and then search for LiveReload in the upcoming window.
Configure LiveReload Package Setting at Preferences > Package Settings > LiveReload > Setting - Default and paste this :
{
"enabled_plugins": [
"SimpleReloadPlugin",
"SimpleRefresh"
]
}
Now for your browser, install LiveReload plug in as below :
Firefox : http://download.livereload.com/2.1.0/LiveReload-2.1.0.xpi
Chrome : https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
Safari : http://download.livereload.com/2.1.0/LiveReload-2.1.0.safariextz
Don't forget to enable the LiveReload plugin in the browser once you have installed it, so you can see the code changes reflected in the browser right away.
Note: Chrome users, for LiveReload to support file:// pages, go to chrome://extensions/, and check off Allow access to file URLs.
Snapshot taken from Safari for Mac OSX:
Enjoy, Live Reload with Sublime Text 3.
Thanks to Anthony Lozano for http://anthozano.fr/livereload-pour-sublime-text-3/.
Instead of live reload, i'd suggest browser sync, does the same thing only better and without the need for annoying browser plugins.
https://www.youtube.com/watch?v=Rv5f_v5gqw4
The plugin mentioned in the comments, LiveReload, is available for both ST2 and ST3, as indicated by the graphic on the Package Control link I just provided. It also works just fine on Windows, as the majority of its users are on that platform. The Github repository may be named "LiveReload-sublimetext2", but if you read the documentation it clearly mentions ST3 as well. The Linux and OS X instructions in the readme are for installation using git. You can also use git on Windows (if it's installed), but the author apparently didn't feel like putting explicit instructions in the README. Instead, the preferred method of installation is via Package Control, as outlined above by kind user DaV. If his comment disappears, do this:
Open Sublime Text 3.
Open the Command Palette with CtrlShiftP.
Type pci to bring up Package Control: Install Package. Hit Enter.
Type in livereload and ensure that the desired package is selected. If not, use arrow keys. Hit Enter.
Read the documentation and either add the appropriate JavaScript to your documents, or download a browser plugin (which you seem to have already done, so good for you).
Go develop.
LiveReload Sublime text3:
https://github.com/Grafikart/ST3-LiveReload
But the usage seems to have changed:
Enable desired plug-ins via Command Palette (Ctrl+Shift+P) add livereload.js to you html document.
A long time has passed. Now, for sublime text 3, the most up to date LiveReload plugin can be found here.
I encounter this problem when I tried to set up live preview of markdown files (I haven't tested on other file types). I think you may be interested.
First, you need to install sublimetext-markdown-preview. Follow instructions there on how to preview in brower.
use cmd+shift+P then Markdown Preview to show the follow commands (you will be prompted to select which parser you prefer):
Markdown Preview: Preview in Browser
Use package control to install LiveReload.
With Package Control:
Run “Package Control: Install Package” command, find and install LiveReload >plugin.
Restart ST editor (if required)
Edit the LiveReload plugin user setting under Preferences->Package Settings->LiveReload->Setting - User, add the following:
{
"enabled_plugins": [
"SimpleReloadPlugin"
]
}
Now you can use livereload as you edit your markdown files.
How to find the exact plugin name
The github repository is unclear how to set the plugin in user settings, it just give a list of supported plugins without giving their actual names. After inspecting the package (see the image below), I found the exact names for those plugins:
CompassPlugin
LESSPlugin
CoffeescriptPlugin
SimpleReloadPlugin
SimpleReloadPluginDelay

LiveReload on Sublime Text 3

LiveReload seems not to be working on sublime text 3 when I download it from the package control.
I found this link (https://github.com/dz0ny/LiveReload-sublimetext2/tree/devel) on github, but there's no info on how to do it on windows (I'm on W7). Is it possible, and if so, how can I do it?
Thanks!
After a lot of trial and error I've managed to get LiveReload working on Windows 8 + Sublime Text 3!
Get the files from the devel branch with the link.
Put those files in your Packages directory: C:\Users\[YOUR USER NAME]\AppData\Roaming\Sublime Text 3\Packages
Restart Sublime Text 3
Enable the 'Simple reload' plugin. You have to repeat this step every time you restart Sublime Text. To do this:
Open the command palette with Ctrl+Shift+P
Type LiveReload
When 'enable/disable plugins' is highlighted, hit Enter.
If you have the browser plugin installed, changes to your files should now immediately be shown upon save. You may also decided to insert the JS snippet, which you can do very easily through the command palette!
I've seen comments about Windows Firewall blocking the localhost with LiveReload. I haven't really had this issue, but I disabled the Firewall the first time, just to be sure. When I re-enabled it and restarted LiveReload, Windows Firewall showed a dialog asking me to refuse or allow the plugin to make connections. So now everything works fine even with the firewall up.
It's actually pretty simple.
The answer given by kslstn and NEKEY are right, but are missing a crucial step if you are working on a local project.
So, after installing LiveReload on sublime text and installing the chrome extension and enabling both of them, make sure, in the chrome extensions page, to enable access to file URLs.
You cannot use Package Control to install LiveReload for Sublime Text 3, it doesn't work correctly.
This method works though:
Navigate to https://github.com/dz0ny/LiveReload-sublimetext2/tree/devel and download the whole devel branch by clicking on "Download ZIP".
Extract contents of the archive to: "%APPDATA%\Sublime Text 3\Packages" and open that Packages folder.
Rename "LiveReload-sublimetext2-devel" folder to "LiveReload", this is an important step to make it work (name has to match).
Restart Sublime Text 3, Ctrl+Shift+P, "LiveReload: Enable/Disable Plugins", enable SimpleReload, ENJOY the amount of time saved by not switching to browser every time you change a line of code.
P.S. You do need to get the LiveReload Google Chrome plugin, just search for it on Google Chrome Extensions Web Store.
You have to download extension for your browser I've found these:
Safari : http://download.livereload.com/2.0.9/LiveReload-2.0.9.safariextz
Firefox : http://download.livereload.com/2.0.8/LiveReload-2.0.8.xpi
Chrome : https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
More info Here https://sublime.wbond.net/packages/LiveReload.
If I understand it correctly, it works via Sockets, so you can't do anything without browser extension.

Silent install of chrome extension using registry

For some reason I cannot get this to work. I'm following the exact procedure described here
http://developer.chrome.com/extensions/external_extensions.html#registry
And I still cannot get the extension listed. If I install it manually, using "Add Unpacked Extension" it works just fine.
Any help would be greatly appreciated
One of many writeups on this subject:
Google on Friday announced that it is changing its stance for silently
installing extensions in its browser. As of Chrome 25, external
extension deployment options on Windows will be disabled by default
and all extensions previously installed using them will be
automatically disabled.
You're much better off submitting your extension to the Chrome Web Store. If you really want to install off-store, consider inline installation.
I have been struggling with installing an addon via the registry as well. I was successful with installing an addon without adding reg keys. And using the preferences file.
I extracted my extension to Local\Google\Chrome\User Data\Default\Extensions\${ADDONID}\${VERSION}
I then added my extension directly to the Preferences file in Local\Google\Chrome\User Data\Default under the section extensions settings ${ADDONID} <-- add your extension. Compare the Preferences file to an instance you have already installed your addon. And copy that to the Preferences file along with the extension directory on a fresh install. And it should work.
This thread gave me some direction:
https://superuser.com/questions/462804/how-to-copy-an-extension-from-one-chrome-installation-to-another

Launching a web page in a different process

I want to launch the browser in a different process when a particular link is clicked on the page. When I checked the net I found the following tip: http://www.dslreports.com/faq/3849 . But there we have to change the registry. Is there any simple way of doing this without touching the registry?
If you use the Google Chrome browser, each new window or tab runs in a separate process. Internet Explorer version 8 will do the same (it's currently in the second beta round).
Earlier versions of IE will run a new window in a separate process if it is launched from, say, the Start menu or the command line, or a link in an email (but not by clicking a link within IE). I imagine you could create a proxy that the client would run through, which would intercept the links you care about and launch them by running a command line request. That seems like more trouble than mucking with the registry though (assuming that registry change still works -- looks like your link is from 2002).
I don't believe this is possible unless you change the client computer setup or software it's running.
Why do you want to do this?

Resources