Chrome Dev Tools - Workspace mapping mismatch - google-chrome

I have a remote webpage that loads a remote JavaScript file called script.js. I don't have immediate access to the remote filesystem to make changes to test something.
So I copy script.js to my local drive, and in Chrome Dev Tools I add my local folder to the workspace. Then I right-click on my remote script.js file and pick Map to File System Resource.... I pick my local script.js.
So now I would expect my locale changes to script.js to override the remote script.js, right? This way I can make some changes to my local script.js and when I reload the page I can see the changes being reflected on my page.
However in the Sources tab, when selecting my local script.js I see the warning at the top:
Workspace mapping mismatch
The content of this file on the file system:
file:///Users/me/test/script.js
does not match the loaded script:
http://someserver.com/js/script.js
Possible solutions are:
- Reload inspected page
- Check that your file and script are both loaded from the correct source and their contents match
So is this telling me that my local script.js needs to be exactly the same as the remote script.js? If so, then what is the point of the local resource?
Isn't it there so that you can make changes to it and see those changes reflected in the browser? If it has to match the remote file, then you must already have access to be able to edit the remote file, in which case you would be making your changes there and not on the local file. If that is the case, then what is the point of having the local resource mapped?
Am I missing something here? Is it not possible to make temporary local changes to a file in Chrome Dev Tools and have those changes be reflected when the page is reloaded? I thought that was the purpose of the Local File System Resources.

Workspaces is built to map the same file that's in file and served over the network. (like serving ~/code/app to localhost:8000).
It will not work for serving a local file as a replacement. There are some Chrome extensions for this, I recommend Flip the Script.

Related

Publish Intranet page is using another user's local publish path for the file being changed

Object reference not set to an instance of an object.
When I publish an Intranet page update, I am getting an error that shows a user's local publish path for one of the files instead of using the web path. It isn't even MY local publish path..
When I publish to my local publish location, the file changed doesn't even publish/update locally.
When I run the project, it seems to work the first time (meaning no error), but when I perform that same task a subsequent time, this is when I get the Object reference error.
How can I fix the project/solution in order to hit the file/code I've changed?
We are using C#, ASP.NET core, Visual Studio 2019, on Windows 10.
I've tried cleaning and rebuilding, deleting upon build, restarting Visual Studio, restarting my system, get latest, undo checkout and start over.
Was replacing just the one aspx file I made code changes to.
Must replace the entire project of files after Publish, not just the select files you (think) you've worked on. Changes are made to files behind and beyond the targeted file(s).
Publish locally, backup Prod files, copy local files to Prod server, Voila!

How to create link in HTML that download that file

I have http://192.168.230.237:20080 Server
file located on "/etc/Jay/log/jay.txt"
I tried with "http://192.168.230.237:20080/etc/Jay/log/jay.txt" this link gives me "404 NOT Found"
Here I can I link my file to link
Your HTTP server will have a configuration option somewhere (Apache HTTPD calls it DocumentRoot) which determines where http://example.com/ maps onto the filesystem of the computer.
Commonly this will be /var/www/.
Unless you change it to / (which would expose your entire filesystem over HTTP and is very much not recommended), you can't access arbitrary files on the computer.
/etc/ is used to store configuration information for software installed on the computer. It should almost never be exposed outside the computer.
The best solution to your problem is probably:
Look at the configuration of your HTTP server and identify the document root (e.g. /var/www/)
Move your website files to that directory
If you really want to expose files under /etc via HTTP then you could also change the document root.
Your webserver might also support features like Apache HTTPD's Alias directive which allows you to map a URL onto a file that can be outside the DocumentRoot.

Cannot get PhpStorm to compare deployed files folder with local

Am following:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html
I have my server setup in the remote host, and can see my directory, folders and files.
I would like to compare a whole folder on my local machine with what is on the server.
It works for individual files, but my developer has changed a whole load of files in the directory.
Please see screenshots.
I try and compare a directory from Remote host to the local server (see screenshot)
Says I failed to download the content of the file (...name of folder) - see screenshot
I try and compare one file (screenshot)
Works fine
How do I compare an entire folder, and see what has been changed?
As per official documentation from the link you have provided:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html#d30440e104
Comparing a remote folder with its local version
Open the Remote Host tool window.
Select the folder in question. Then choose Tools | Deployment | Sync with Local on the main menu or Sync with local on the context menu of the selection.
In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
The same but when invoked from Project View panel:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html#d30440e154
Comparing a local folder with its remote version
This action is available only if you have a default server access configuration appointed.
Select the folder in question in the Project tool window, and then choose Tools | Deployment | Sync with Deployed to on the main menu.
In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
In that Differences Viewer for Folders screen you can:
See a list of files with differences (or that do not exist of one of the sides) -- top part;
Choose any file and see the actual difference/compare them -- bottom part;
Also choose to upload/download such file(s) or merge them manually.
(screenshot from JetBrains website)

Chrome Extension edit source file

I have a chrome extension that is installed via "Load unpacked extension," and I am trying to get it to delete itself or at least change its source code when a function is called. I have the chrome.management.uninstallSelf down, but I also need the source files for it to become changed/gone. Basically, I need the chrome extension to open the local file where its source is located and then delete/change some of the files inside it. Is there any way to do this?
Basically, I need the chrome extension to open the local file where its source is located and then delete/change some of the files inside it. Is there any way to do this?
No, this isn't normally* possible.
Chrome extensions have only read-only access to their own files (via chrome.runtime.getPackageDirectoryEntry or requests to chrome-extension://), and no access at all to the rest of the filesystem.
* All bets are off if you have a Native Host module though. It can do whatever, but would greatly complicate installation.

css is not working after uploading the file on server with filezilla

css is not working after uploading the file on server with filezilla i added file permission 755 on server and even after that it's not working.
I have changed /web/assets/d01711d6/css/bootstrap.css.
css is not working after uploading the file on server with filezilla i added file permission 755 on server after that it's not working.
This may depend on several factors.
Cache
If the application is hosted it may be that it is a problem of the server cache so the new CSS file is read to the cache expiration (sometimes several days). In some cases the provider it provides configurations for enabling a temporary mode that disables this mode and promptly update the files.
Asset Management
Another factor is related to the fact that the directory where content assets are dynamically generated so not always the name of the directory in the development environment and the production server match. It is in these cases to find (looking for it) the actual directory used by the server and replace the file in the right place.
If, as the practice, changes to css file was made in the original directory and not on the copy of the file created by dynamically from asset management, one usually proceeds by eliminating the directory containing the assets of interest and the first subsequent invocation of the application (the URL / link) a new directory of assets is created for these files