I have a Powershell script that opens an html file saved locally and parses the file. When it is run from the server where it was created it works fine. However, when I run it from the server where it will need to reside going forward, I keep getting an IE Security pop up. The code is:
$Source = Get-Content -Path $SrcFilePath -raw
$HTML = New-Object -Com "HTMLFile"
$HTML.IHTMLDocument2_write($Source)
$results = $HTML.all.tags('table') | % OuterHtml
The variable $SrcFilePath is the path to where the HTML file is stored locally. When it gets to the line
$HTML.IHTMLDocument2_write($Source)
The pop up appears.
Once I click "Close", the script resumes. The issue is, this script is going to be automated so no one will physically be around to click the "Close" button when it is appears.
I've tried creating a share to where the html file is saved and adding it to the Trusted sites in IE. I've changed the security level and I've also added about:security_scriptdriver64.exe to Local Intranet in IE, but none of these have worked. Any ideas?
DETAILS UPDATE
The server I'm running this on is Windows 2016 and the IE version is 11.
The html file I'm parsing is saved locally on the server i.e. E:\temp\webpage.html
When I created the share and added it to the trusted sites (I tried with both NetBIOS and FQDN), the option "Require server verification" was unchecked.
I've also tried adding about:security_scriptdriver64.exe to Trusted Sites.
I've also turned off "IE Enhanced Security Configuration" through Server Manager for both Admin and Users and this did not work.
UPDATE 2
I had mentioned in my last comment that I had put about:security_scriptdriver64.exe to Trusted Sites, tested, and it did not work. I started looking into using Invoke-WebRequest and playing with that. Was having issues so I thought I would go back to the IHTMLDocument2_write solution. I thought I would use a bare bones html file to start with that I had one table, with one row, and one column. My plan was to slowly start adding tags from the original html file to the barebones. I got as far as updating the title tag when I thought I would try again with the original. It worked.
I removed the about:security_scriptdriver64.exe from Trusted Sites and tried again. It still worked. I left it and everything worked fine so back to the drawing board.
I started again by adding that about line to Trusted Sites. Didn't work so started with the barebones HTML again. There is a block of JavaScript in the file. When I added it, to the barebones file, it didn't work. When I removed it, it worked. So, it's the JavaScript. I still don't understand why it started working last week. The HTML file is always generated with that JavaScript block. SMH.
Related
I'm working on a large project, which uses IE (IE11) to display local htm pages. (Yes, IE is required. I can't use a different browser). We aren't using a web server; everything is pulled from the local drive. No http requests are made during this.
We're planning to send parts of it out to remote locations to use on those sites. Atm I'm using a self-extracting rar, so that the htm, js, css, and media files can all be put in the proper locations. After deployment, the file structure on the remote location should mirror that of the Dev system. Everything works fine on the Dev system. However, at the remote sites some of the anchor links stop working. After some testing, it appears that if the file I'm trying to link to originated from a different computer, the link does nothing. But if I were to make a new file, copy everything from the old file to the new file, and replace the old one with the new one, the link works. The files are identical in content, but only the one that originated from the remote site works.
Link
The above would work if foo.htm was created on that computer, but not if it was created on a different computer (such as the Dev computer). This issue appears to occur with .htm/html files, as well as .css and .js files. It might also occur for media files, but I didn't check.
I imagine there is some kind of security setting or something that needs to be changed, but I can't figure out what. We plan to distribute to a lot of sites, so I can't manually fix the problem for every site.
Any idea why this is happening?
Edit: No errors pop up in the console when I click on the links. I didn't check out the network tab, since everything is local, but that might be a thing to try tomorrow. Also, I didn't know about file blocking. I'll check that too. If that were to be the case, how can I unblock the files automatically? This may be deployed to people who don't have a strong grasp of computers.
From the description of the issue, it looks like when you send the zip file to another machine then on that machine file gets blocked.
Below are some ways to unblock the file or to prevent the blocking. You can choose the suitable way as per your requirement.
The easiest way to unblock the file is to, right-click the zip file then click on properties and click on the Unblock Checkbox and click the OK button. Then after try to unzip the file. It will unblock all files together.
You can also try to unblock the zip file by using the PowerShell command below.
dir "folderpath" -Recurse | Unblock-File
Note: Make sure to run the script as an administrator.
Further, you can set a group policy to prevent blocking the file.
Group policy path:
User Configuration-> Administrative Templates-> Windows Components-> Attachment Manager
Policy name: Do not preserve zone information in file attachments
You can double click this policy and disabled it.
Note: Please note this will leave you vulnerable to malware & is not recommended..
I started using debugger for PHP recently and it's working well, but I have one problem. When I open page from Chrome I get notification from PHP Storm "Incomming connection from XDebug"...and I can accept or ignore it, which is ok. Then I can debug. And that's connection for the first page, i.e. index.php
Problem is that on page I'm opening I'm displaying i.e. some images and I'm including some CSS or JS file. For all those files Chrome is making additional requests and for all of them I'm getting also that message "Incomming connection from XDebug". So for every valid request I have to click Ignore about 20 times more...to ignore every other file after first one, containing page source.
I tried adding path to dirs I want to ignore in "Skipped paths" under Languages & Frameworks -> PHP -> Debug, but it's not working.
Can it be set somehow? Maybe some obvious ignores - I can't debug i.e. image files.
A little background info...
By far and large the URLs worked perfectly fine. Occasionally either my machine, or the server itself couldn't access the Web Service URL or the Report Manager URL. For the server a restart fixed this, for me I had to reset my winsock which never worked and ended up System Restoring to a working date.
When I say couldn't access I mean getting the "This Page Cannot Be Displayed" message, or the "Please turn on TLS 1.0 etc etc" message.
The last few days the issue is now widespread. Everyone was having issues gettings to the URLs even the server. I figured it may have been some windows updates causing issues so I removed all the updates around the timeframe in which it started and tested and got nothing.
Came back the next day (today) and same issue except the only way to access it is through a hyperlink thats clicked or copy/pasted.
The issue:
If you manually type the URL it will not work. You have to copy and paste the hyperlink from a working page. I used a link to a rendered report and deleted back to /ReportServer and it pulls up the directory. I've never seen something like this happen before.
The Solution:
Apparently you have to type in www. as well
I was so use to skipping that for most pages.
https://analytics.domain.com/ReportServer = fail
https://www.analytics.domain.com/ReportServer = win
I am working on a local project (read: offline) and I am trying to get Brackets' live preview to work since it comes in handy quite often.
Right now I have opened my project files using Brackets' "open file" option since it supposedly maps the path to the source files. Although I am getting an error saying In order for Live Preview to connect, Chrome needs to be relaunched with remote debugging enabled.
I have read else where that Chrome, by default, does not need to be relaunched for that change and that Brackets force this flag by itself.
I have tried reinstalling Brackets, launching with another project and searched all over Chrome for this flag and did not find any thing.
Any tips?
This page shows you how to instal remote debugging! It's a Chrome dev tool. It's geared towards android apps for whatever reason, but I had that same error, and following the instructions on that page helped me launch the brackets page.
If that doesn't work, here are some troubleshooting tips that have helped me out with live preview:
1) Make sure your filename has a .html at the end
2) Use different browser (I've found chrome to be a bit finicky with brackets)
3) Make a different blank file, launch that, then launch the file
Open the folder, not the file, and then select the file.
I have an enterprise box account, and I was tasked with creating a crawler that would scan an account on box and save all meta information (including a direct link) in a local database. This works fine.
in PHP I have also built a function that downloads the documents (via the direct link I obtained from the api) and extracts readable text from them. This was working perfect a week ago, yesterday however this stopped working completely. I'm using the file_get_contents() function to download the file, and currently it only retrieves the document's file size rather than the document itself, which I find strange. I have tried CURL and I get the same result, it seems box is responding to my direct file requests with the file size instead of the actual file.
The files are ALL open access, so anyone with a direct link can download the file without logging in. I have also tried running this code on another server in another hosting company and I get the exact same result. I have tested my code by accessing other files from other locations (not box) and it works fine.
It's important to note that this was working fine just a week ago, but now it doesn't work at all. Nothing changed in between on my end, (that I know of). Anyone have an idea?