Phantom Stylesheet - html

I have a situation where IE seems to be loading a non-existent xls file.
I am using MZTools to document some VBA code in Excel. MZTools has an xsl file called sample.xsl, in C:\Program Files\MZTools3VBA.
I saved the original xsl and made a bunch of modifications to get the layout the way I like it and it works fine.
A couple of weeks later, I decided to tweak it a bit more but, when I opened the xsl file it was the original content (as-shipped sample.xsl). I thought: OK, I guess I made a mistake when managing the versions of the file.
The strange this is, the changes I made persist. When I created a new xml report, IE is still loading the modified styles.
MZTools is set up to use the default xsl file to style the report and that's confirmed by the xml it generates.
MZTools settings...
MZTools-generated xml...
The href points to this file...
...which has the original style selectors and a slightly different annotation at the top
but this is what's loaded by IE...
It has the styles and annotation of the modified file
I changed the name of the xsl file to see what would happen and it made no difference, its as if the file is there but as a phantom copy that IE can find.
IE still pulls the new styling from somewhere
My question is: Where is my <!--expletive deleted--!> style file?

I figured out the problem.
Probably because of structure created by Aptana Studio when promoting a system folder (requiring Administrator rights) to a project, that was not removed when the project was deleted in Aptana, files open in Aptana's workspace (even after Aptana is closed) will dissapear from Windows Explorer Folders if they are subsequently re-named. But they will still be visible to IE!
So if you have a file open in Aptana called file1 and you close Aptana and re-name the file to file2 in Windows Explorer, then file1 will remain as a separate, but invisible file in WE. IE however, will continue to resolve references to the file1. And subsequently created, distinct references to file2 for that matter!
Open Aptana Studio 3 and open sample1.xls from the file system
-sample1.xsl is in a folder in C:\Program Files\MZTools3VBA
Edit the xsl
Open an xml file referencing sample1.xsl in IE and confirm the edits. Leave the page open in IE
Save, then close AS
Navigate to C:\Program Files\MZTools3VBA in Windows Explorer and
change the name of sample1.xsl to sample12.xsl. Now, acording to WE, there is no file in C:\Program Files\MZTools3VBA called sample1.xsl.
Refresh the page in IE -it refreshes fine, IE found C:\Program
Files\MZTools3VBA\sample1.xsl Check again: No, still can't see
sample1.xsl in C:\Program Files\MZTools3VBA with WE
Open Aptana Studio -sample1.xsl is open and hovering on it's tab
shows it is located in C:\Program Files\MZTools3VBA.
Navigate to that folder in AS and yep, there it is. Check again in
WE... nope, still not there.
Make some edits in AS and save and refresh the page in IE to confirm the edits. Yep, IE shows the edits: according to IE, the file still exists.
You can see in this screen shot, that sample1.xls (which is open in Aptana) and another file called sample.xsl.bak, are invisible in Windows Explorer...
Thats a day I'll never get back...

Related

Unable to modify value of "prompt_for_download" in chrome preferences file

Gurus,
I am using uipath(A Ui Based Automation Tool) to download a file from a website using chrome browser.
I want browser to not prompt before downloading and just download the file in the downloads folder.
From various posts on this website i found that there exists a file called "preferences" which can be modified to solve this problem.
Before coding further i decided to do the changes in the "preferences" file manually on multiple machines, just to make sure that the changes i do in the preferences file reflect in the chrome browser as well .
I am manually modifying values for these 2 options in the preferences file.
download.default_directory
download.prompt_for_download
When i changed value for download.default_directory(Manually in Preferences file), it reflects the same in the chrome browser settings on every machine that i tested on.
But When i change value for download.prompt_for_download, it reflected in the chrome browser settings on some of the machines while on others i found that it does not reflect in the browser and rather the preferences file also seems to have reverted back to previous values.
The steps i followed are as below..
close any running instance of chrome
do the modifications in the preference file and save it
open chrome and go to settings>advance and downloads
i see DreamCatcher pointing to a similiar situation in this post, but no answers there..
I hope I can help solve your issue or at least give you some direction :)
Option#1: Chrome Settings
Wouldn't the problem be solved by changing the settings for downloads in the browser before running the bot? https://support.google.com/chrome/answer/95759?co=GENIE.Platform%3DDesktop&hl=en
Option#2: Do it in UiPath
And the other thing, is that when the prompt (to save the file) appears, couldn't you insert the path of the file that includes the default folder to save + name file + extension? (e.g. on the save path of the prompt, use type text "c:\myDocuments\downloads\filename.ext" ? I've done this in the past with UiPath...get the prompt window, type text and just modify the string being passed to carry the path, file name and extensio...then click "SAVE" or use hotkey "Enter"(if the file requires replacement, these are another 20cents you will have to program in UiPath, but it'd doable).
Option#3: Script
Another option, which I have not done, but see my friends do is creating BAT files to reset certain browser settings or the "registry"...so what they do is that they configure the BAT to do the changes to the browser and they add an activity (in UiPath) to invoke the BAT file every time the browser is opened by the robot.
Links for reference:
https://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line
https://getadmx.com/?Category=Chrome&Policy=Google.Policies.Chrome::DownloadDirectory

Chrome's map to file system resource not working after update

I can add a folder to the workspace (which doesn't seem to do anything, as far as I can tell), but the "map to file system resource" option seems to have been removed, and I can no longer live-edit css files.
Is this a bug, or has the process for mapping css files been changed?
This talk (https://developers.google.com/web/updates/2017/10/devtools-release-notes) says that the new version uses "magic" to map remote files to local ones, but I can't seem to get it to work at all.
For reference, I'm trying to map a reddit css file to one on my own computer. It worked fine on a previous version of Chrome (basically I add the folder, and map the css file inside it, which has been renamed to have the same name as the remote one) but not on the new one (Chrome 63)
I've just fiddled around with a problem, where only some files got mapped to my local workspace.
Turned out that Google Chrome also checks and compares the last modified date of your files.
If the file on the server has a more recent date than your local copy, this file won't be mapped.
I deleted the Bootstrap file on the server side and uploaded my local copy, which has an older last modified date. Google Chrome instantly mapped the file to my local workspace.
Out of curiosity I ran touch bootstrap.min.js on my server to set the last modified date to today. This broke my file mapping again.
Chrome removed manually mapping to filesystem resources because of the new Workspaces 2.0 (See: https://developers.google.com/web/updates/2017/10/devtools-release-notes).
You should be able to drag and drop your folder into the sources tab and it'll link the files automagically.
However automatic mapping doesn't work in many situations and there is a Chrome bug to re-add manual mapping
I had the same problem so I downgraded to Chrome 62 (preferences, history, extensions and so on are preserved).
Download Chrome 62 from
https://www.slimjet.com/chrome/google-chrome-old-version.php .
On OS X trash /Applications/Google Chrome.
Switch off auto-update by setting "defaults write com.google.Keystone.Agent alwaysPromptForUpdates 1". Default is 0.
May be you have to set "defaults write com.google.Keystone.Agent checkInterval 0" too. Default is 18000.
Install Chrome 62 as usual.
After starting Chrome 62 open "About Google Chrome". Chrome is checking for updates, but will prompt you to confirm.
The "Map to File System Resource..." menu item is missing. There appears to be no way to map files. It is completely broken as far as I can tell.
For me, the problem turned out to be the presence of the copyright symbol © in the file headers (which affected just about every file). With this character in the files, devtool refused to map the files but with it removed, the files map fine.
I'm also using Chrome 63.0.3239.132 (Official Build) (64-bit) and as I wanted to use the DevTools Live-edit to edit some js files I saw that the option "Map to file system resource" is missing.
After some research I have found out that the Live-edit is perfectly working in Version 63, you just have to:
go to Sources and then FileSystem
add the folder with your code to the workspace
After that, a small little green point will be displayed near your files (it means the synchronization is ready) and the changes via DevTools can be persisted locally:
Thanks to others in this thread saying chrome is checking the modified date.
Adding this to .htaccess solved it for me
IndexOptions SuppressLastModified
Of course you would not want this to get into your production code as it could stop browser caching working.
I cleared the cache and it works now.
Previously, I opened my CSS file from my FTP client, then I dragged the containing folder into the Sources tab > Filesystem tab (without caring about any folder names nor structure, I just dragged the FTP clients containing folder into it).
The persistent mapping worked straight away, edits from the Chrome Dev Tools were saving on the server. After 30 minutes of fiddling and playing around, it just stopped working and the CSS resource got greyed out. The file icon with the green dot was not appearing anymore.
It didn't matter what I'd do, it would not work, but when I cleared my cache, it started to work again.
File mapping started working reliably for me once I turned on a devtools setting -- click the upper-right gear icon and check Preferences > Network > "Disable cache (while DevTools is open)"
As of today, with Chrome Version 63.0.3239.108 (Official Build) (64-bit):
The feature appears to be still broken, not working 'automagically' nor consistently with the previous behavior.
However, adding a folder that reflects the resource's URL as seen in the Network tab, make it work again. So if for instance, in the Network Navigator tab you have:
http://mylocal.site/wp-content/themes/mytheme/assets/sass/partials/_header.scss
You will just need to add the whole wp-content/ folder to the Filesystem tab to get the feature work again as expected.
Had the same problem, but when my source maps included sourcesContent, the file mappings were automatically made and I could live edit my scss. Apparently chrome uses the content to find the right file.
node-sass --source-map-contents

Local HTML files not opening properly

I'm having an issue with a local .HTML file.
Everytime I try opening it on ANY browser and on ANY computer it does not work, it opens normally for a brief second and then I get the screen saying the file path could not be found. If I spam refresh fast enough I can read the first lines.
The .HTML file has been extracted from a .war file.
If I copy the code into a new file and open that one, it opens up nicely.
The weird that got my attention was the path for the files themselves on the browser
The one directly extracted from the .war file is as follows:
file:///C:/Users/username/Desktop/New%20folder/help/User_Guide.html?1userhelp.html
but there is no file "User_guide.html" on the folder
If I create the same file just under the desktop directory it opens up without problems, so the issue is not the content of the file itself.
Does anyone have an Idea to what may be causing this problem?
As suggested by SunnyPatel
We aren't sure which OS you are using, and so case-sensitivity may play a part in this. If you're on Windows, you can try viewing the parent folder in the browser, and see if you can click on the file within the default index page and open it from there
Opening the file by first going into "/index.html" worked just fine. The whole navigation flows perfectly, the issue was just me trying to open the file directly.

Convert json formatted Chrome bookmark file into html

How can I convert json formatted bookmarks file (taken from /Library/Application Support/Google/Chrome/Default/Bookmarks) into an bookmarks html file so Google Chrome can import it?
This has more or less been answered in comments by #Mr.P, but let me formalise:
In my example I have a current (OS root) drive called C:\\. I have a storage drive of F:\\ which has a previous install of Chrome on it which I want to retrieve the bookmarks from.
I did this in Powershell but you could easily do it in file explorer you would just need to either enter the path to <drive_name>:\\users\<account_name>\appdata manually/show hidden folders.
close all instances of Chrome currently running (maybe check in the process monitor to ensure all processes terminated).
navigate to <storage_drive_letter>:\\users\<account_name>\appdata\local\google\chrome\default.
On PowerShell you would select the previous install bookmarks file by entering $books = Get-Item bookmarks. On file explorer you would 'cut'
cd <os_drive_letter>:\\users\<account_name>\appdata\local\google\chrome\default or navigate to this path on file explorer
mv $books . or paste file
open up Chrome again and check the bookmarks: they should be visible all together.
[optional] If you're brave close all Chrome windows once again (potentially save both files somewhere else before you do this) delete all files with 'bookmarks' at the start (you can use gci | where {$_.name -like "bookmarks"} | rm) then reopen the browser. In your filesystem Chrome should have automatically regenerated the bookmarks into one file.
If this doesn't work for other people let me know
If for whatever reason, you only have the JSON output of the Chrome bookmarks file, don't sweat it. Chrome will export bookmarks as HTML and import as HTML. But, sometimes you don't have the luxury of exporting from Chrome because of some issue with your Windows installation. But, you're resourceful and managed to at least get access to your Windows filesystem and backed up your Chrome bookmarks file. But, now how do you import it to Chrome on a working computer without it being in HTML format?
On Windows (this was tested on Win 10), all you have to do is Show Hidden Files and Folders and then paste and overwrite the Bookmarks file at:
C:\Users\YourUserName\AppData\Local\Google\Chrome\User Data\Default
Don't run around in circles trying to convert JSON to HTML if you have a Windows computer. I'm not sure about Mac and Linux, but I'd bet it would work similarly.
Folder location of bookmark (on February 2021)
Chrome: %LOCALAPPDATA%\Google\Chrome\User Data\Default
Edge: %LOCALAPPDATA%\Microsoft\Edge\User Data\Default
Note: "Default" could be something else (e.g. Profile 1) if you are not currently logged in.
Finally i found it
Step 1: Goto Run --> enter - appdata to navigate to this folder
Step 2: You Needs to take backup/copy of your old bookmarks and keep it one place
Step 3 : then you need to navigate to below folder, you can find many profiles of yours.
Navigate to the needed gmail account profile which has your display pic or profile pic
[identify the account you want to import bookmarks]
Go back to the profile 12 [the account which i want to see the bookmarks]
Then replace your old bookmark file here[step 2:which you taken backup bookmark file]
Boooooom! just restart chrome
I think you are making this harder than it is. Save the JASON bookmark.file, first. Go to C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default to save the Bookmark.file somewhere on your computer. Then uninstall the browser (Chrome, for example). Make sure you check the box to remove all history, etc. before you click on Uninstall.
Reinstall the browser, then overwrite the Bookmark.file in C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default
DONE! Bookmarks restored. No need to save bookmark.file or convert it to an HTML file for restoral. Just overwrite the bookmark.file with the one you saved before uninstall of your browser.
If you're worried about modifying existing programs, or overwriting any other bookmarks you've currently got, then I found the following easiest:
Install a portable version of Chrome, for example from portableapps.com
Navigate to App\DefaultData\profile\Default inside the install directory
Replace the Bookmarks file with your json file
Launch Chrome Portable, and export the bookmarks as html
Delete Chrome Portable
I had same problem with opera. I simply copy pasted that json file into new location of new installation.
Just drag the .json to opened firefox window and the run bookmarklet
(create new bookmark, enter code in location)
CODE: SELECT ALL
javascript:(function(){var E=document.getElementsByTagName('PRE')[0],T=E.innerHTML,i=0,r1,r2;t=new Array();while(/("uri":"([^"]*)")/g.exec(T)){r1=RegExp.$1;r2=RegExp.$2;if(/^https?:/.exec(r2)){t[i++]='['+(i)+']:'+r2+'</a>';}}with(window.open().document){for(i=0;t[i];i++)write(t[i]+'');close();}})();
Thanks to dickvl
Clickable links result
Save webpage complete will save .htm
Save .json to desktop, drag browser window smaller from lower right edge till you can drag the .json into opened window., doubleclick titlebar to restore browser full size. In the tab that opens with .json data, click the bookmarklet. Another tab should open with links. You can save as .htm by right click "save page as" web page complete.
Anywhere in the opened window, like dragging a shortcut or html, it'll open
You can also do File > Open File > browse to .json > open
Using JSON
Backup your bookmarks as a JSON file.
Delete the bookmarks you do not want.
Export the ones you do want as an HTML file
Restore your bookmarks with the JSON file
To add mor in the JSON file in a text editor.
Create rows by finding and replacing ',{"title' with 'return{"title' (Don't type the single quotes and, in the replace field, use the appropriate substitute for return: ¶ or \r, for example. My search looked like this: Find: ,{"title Replace: \r,{"title Replace All gave me rows instead of a continuous stream of text.
Save the file as text and open it in a spreadsheet. Each bookmark will have its own row. The site name, URLs, and other data are in columns.
Create a bookmark by copying the URL, pasting it into Firefox, and going to the website.
Drag the URL from the toolbar to the desired location in the sidebar. Change the bookmark title if you don't like the website-assigned title.
Repeat as needed.

Change to this file were not saved to file system error in google chrome version 30.0.1599.101 m

In the google chrome version 30.0.1599.101 m I am not able to save the changed js file.
On saving the js file I got yellow triangle symbol with "change to this file were not saved to file system" message.
I know this used to work in older version
I am using windows-7 64 bit
Click on the cog in the developer tools window (lower right corner)
Go to workspace and add the directory which you would be working on.
This is to accidentally prevent you from modifying files that you did not intend on changing.
Happened to me too. After picking the workspace directory, I also mapped the file from the "Source" panel of Devtools to its filesystem equivalent (using right-click on the file, from the file tree). It solved my problem.
In chrome > 63, accepted answer option is disabled.
In later should be done through workspaces.
Tonight, I accidentally managed to fix this problem, just open the file on the disk and save it with a simple change even with a space.
Refresh the page in Chrome, Chrome will link it(The file) to the disk.
Using Ctrl + F5 to clear the browser cache worked for me.
I found nothing in "workspace" that seemed relevant, and other things people listed didn't help either. What helped was to go in dev tools, where it says Pages, Sources etc., there is also Overrides (duh :)), I chose it, it said "Select folder for overrides", I did, and then also clicked "Allow" on Chrome asking for confirmation. That's it, after that I was able to save the files, the overrides worked.
Ok, my case might be a bit different but I will share my experience on what I was facing that caused to this warning and how I solved it.
I was trying to check a certain strange behavior on a React app for video streaming, so I opened up Developer console, enabled local overrides and tried editing the js file, immediately upon saving I got the warning “Changes to this file were not saved to file system”.
Note the message at bottom right “Source mapped from app.bundle.min.js”, this indicated that this is not an actual file but a mapping from the app.bundle.js (Webpack bundle)
So I moved to editing the app.bundle.min.js, I searched the appropriate string I was interested in from the mapped file (react-dom.production.min.js) and searched it in app.bundle.min.js
Again I got the same warning but I noticed the “app.bundle.min.js” file was fetched using a url parameter ?v=4900, I decided to remove it to check if that was the culprit causing the issue, to achieve that I modified the index.html file and edited the script tag that was fetching the js file from
<script src="libs/app.bundle.min.js?v=4900"></script> to <script src="libs/app.bundle.min.js"></script>
After that I forced refresh the page (Shift+F5, normal refresh didn’t work), tried modifying and saving and Jackpooot!! (Take away: You can’t override files fetched with a url parameter). I then was able to beautify, modify and override the app.bundle.min.js implementation and achieved what I wanted.
On Chrome Version 109~ :
Go to F12 > Sources Tab > Overrides (You may need to click the chevron next to Page)
Select/Create a folder to contain Overrides
You can now right-click a file or editor window & save it for Overrides
Image of sources tab where Overrides is located
Something to note: if you are making dynamically loaded JS available in devtools via the helpful: //# sourceURL=Example.js comment, this network to local mapping will not work.
Note: Notice the "//# sourceURL=dynamicScript.js" line at the end of dynamicScript.js file. This technique gives a name to a script created with eval, and will be discussed in more detail in the Source Maps section. Breakpoints can be set in dynamic JavaScript only if it has a user supplied name.
https://developer.chrome.com/devtools/docs/javascript-debugging
When you're using sourceURL, you can't actually find the respective JS file in the Sources tree where you might expect it to exist. It is available to open via the "no-domain" tree, however (or quick open with CTRL/CMD+P).
I'm still looking for a solution.
The easiest solution I found to this problem:
(keep in mind, I was manipulating an html page that lives on my machine)
open the associated html page from the command line so the page displays
for mac, that's simply $ open <name>.html
open Dev Tools
open Sources tab
in Page, open a new .js file there with whatever name you need
write in some text and save
This worked for me. Yes, I had to create a new .js file, but my directory locally recognized it was there when I pulled it, and my editor was updating in real time with the dev tools each time I saved either. At that point, my editor and the dev tools source tab had become one thing.
Currently on Chrome 100.0.4896.60 (Official Build) (x86_64).
I've got a js file with source maps; the override has always been spotted.
I'm able to override the map file (which won't work though for the debugging purpose) and the index.html file.
Apparently my issue is related to minified js with source maps.
Seem to work in relation to the chrome version installed.
I tried the following attempts but didn't work:
remove cache
disable / enable override
add the dir to the workspace
install chrome canary
To debug then I've tried:
build my file.min.js to test. In my case was production/file.min.js
start a npx http-server in production (cd production && npx http-server) which open to http://127.0.0.1
override index.html to consume http://127.0.0.1/file.min.js
Interesting considerations:
When i was doing basic overriding i had to replace the file manually all the times.
Now, I've got a watch task going on and i can basically refresh the page.
I can see as well the source map update.
It's simple! Right click on your page, Go to Inspect, go to the Network tab and tick the check box 'Disable cache'. Reload the page and you will see the effect.