I have a PHP script running on a website which logs the number of times access is associated with a key:
http://www.mywebsite.com/admin-query.php?key=8469f8847b8b4d05364ae400d4071d93
If the URL is incomplete and I go to manually alter the URL in the top bar of Safari 13.0.5, when the URL matches what was previously entered, before I even press return, I notice that the script has been run and my access tally associated with that key in MySQL database has been incremented.
To be clear... altering the "admin-query" in the URL to "admin-query1" and then back again without pressing return causes the "Top Hit" and "Google Suggestions" popup to appear, at which point the PHP script is run.
How can that be so?
I've tested with Chrome 81.0.4044.122, and didn't see the same result.
Related
I have a moderately complex script (create about 20 different tables, approx 1500 lines). When making changes, I only need to run the part of the code that comes after the change. I normally dont have any issues with this, but today, I selected lines 800-1500, hit ctrl + enter, and when it completed the run 6 minutes later, I found that all of the code above the line I started the run from (ie lines 1-799) had been deleted.
When I hit ctrl+z nothing happens, so somehow the change has been locked in. I have some earlier versions of the script, but there are changes in here that got deleted that I dont have saved anywhere else.
Two questions:
why is this happening? any way to prevent it from happening again? (other than stricter version control, or running the subset of the query in another query editing window)
Any way to recover the deleted code if ctrl+z doesnt work, and it's not in the query history as I didnt run that piece of it today?
notes: using BigQuery web interface for this
Something caused your browser tab to reload itself. The URL in the browser immediately updates itself with a new job_id parameter every time you execute a query, and going to that URL (via reloading the tab or otherwise) will display the exact SQL executed by that job and the resultset if the job has finished. If you've only highlighted a portion of the query -- welp, that's the query that got run so that's the query that will be displayed when you revisit that url. :(
The new "editor tabs" feature has been causing this for me: I have to click the "disable editor tabs" button at the top of the bigquery UI to prevent the page from reloading when running queries with multiple stages. But there are an endless number of possible reasons that your particular tabs might be reloading on your particular system, so here's a second fix:
Use /* */ SQL comments to block off the parts of the query that you don't want to run. The comments are part of your query and will therefore still be visible even if the browser tab reloads.
I'm getting a popup in IE 11 browser 'long running script' and page stocks. How can I find what script is producing it?
The way I used to find the problem script.
1) View page source on the browser without issue.
2) Save source to HTML file.
3) Place file to the same domain so it can load domain related files.
4) One by one remove javascript from HTML code and checking if an issue has gone on IE browser.
Press F12 to open the "Developer Tools Interface". Change to the Network-Tab and refresh your page. It should show you what is using how much time to load.
I'm using Chrome to get the HTML of a webpage which is generated by javascript. The applescript which does all this needs to run every 2 minutes. Everything is working perfectly, except that I obviously need Chrome to do this completely in the background. My script contains the following uses of Chrome (as well as a block to set theTab, which doesn't seem to ever cause Chrome to come to the front):
set URL of theTab to theURL
set isLoading to (loading of theTab)
execute front window's active tab javascript javascriptLocation
set theSource to execute front window's active tab javascript "document.documentElement.outerHTML"
Putting this line:
tell application "Finder" to set visible of process "Google Chrome" to false
after each of the above lines either produces no hiding at all, or at best Chrome flashes onscreen and then goes away. I find this very distracting.
Is there any way to have an application run reliably and permanently in the backround? Or, failing this, is there an invisible way to get javascript executed server-side so an applescript can get hold of its generated source?
Chrome 66.0.3359.181 running on Mac OS 10.11.6, Applescript 2.5.
The following is not an answer to the question I posted, but it is an answer to the problem I was trying to solve which is why I posted the question.
As stated in my question, I need to get hold of the HTML which some javascript generates on a site (which is not under my control). I can't do a client-side scrape because of CORS restrictions on the site. I tried the cross-domain tools listed here and couldn't get them to work.
So I was using Chrome's applescript command, execute, to first execute the javascript (to produce the HTML), and then a second time to grab hold of the HTML with document.documentElement.outerHTML. But having Chrome flash onto the screen every 2 minutes throughout the day was doing my head in.
Turns out Chrome can also run in headless mode, from the command line, and just happens to have an option to run javascript and return the generated HTML!
So my code got a whole lot simpler and I don't have to have Chrome in my apps list all the time. Happy coder am I :-)
Here's the one line that gets me the HTML generated on the site I need:
set theSource to (do shell script ((quoted form of POSIX path of googlePath) & " --headless --dump-dom " & theURL))
Thanks, once again, #matt. I'd never heard of headless mode and would never have found this without your suggestion of PhantomJS!
Got a Selenium IDE script recorded and being played back using Selenium Server in -htmlSuite mode.It is supposed to put the type the User Name, Password and Domain then click Login. After logging in, at one corner, it should show UserName # Domain. I have a verifyText for this. When I ran the script in Firefox, it is working correctly, but in IE, it keeps failing - giving me an error message Actual value 'UserName # Domain' did not match 'UserName # Domain'. I tried also assert and same thing. Is this a bug in Selenium or something?
You should try using waitForText, waitForElementPresent or waitForTextPresent commands, depending on your specific need.
The reason being that usually, when any text is created by a script on/after the page load, Selenium doesn't know about it - it can't possibly wait for every script to finish, because there's a lot of scripts that never finish and run forever. Therefore, you need to wait for your specific elements to appear before you can assert them.
In order to automate DOH tests during our build process, I use Selenium RC to launch different browsers (IE and Firefox) on a server placed on a different domain than the build machine. Each browser is directed to our runTests.html in order to start DOH.
Sometimes, when a test that uses doh.robot starts, the following message is shown:
"DOH has detected that the current web page is attempting to access DOH, but belongs to a different domain than the one you agreed to let DOH automate. If you did not intend to start a new DOH test by visiting this Web page, press Cancel now and leave the Web page"
but since these tests are unattended it just sits there waiting for someone to click OK, and Selenium times out (in IE 8 it seems like the pop-up disappears automatically but the robot does nothing afterward).
As I said, it doesn't always happen. After you click OK on the Pop-up, the message will stop showing, and the message can go away for several sessions, but then it will show again in which seems to be an arbitrary way.
Does anyone knows a way to prevent this pop-up from showing?
This is probably not the correct way to do it, but in util/doh/robot/DOHRobot.java, you may be able to modify the code to not check that or always simulate pressing "OK". I haven't tried it myself, but I may also need to do that for some of our automated testing.
When the DOH robot is initialized, it first tries to click in the upper left corner of the page you are trying to test. If you obscure this div (you can see it with firebug), then the message will pop up. I think the problem is that your page isn't always loading up quick enough.
It is somewhat of a challenge to fix this. I haven't used DOH in awhile, but I don't think there is any way you can use a setTimeout to fix this. (You can try using setTimeout on the doh.run command, but it might be the case that the DOH robot clicks that div before parsing any doh commands.)
Another thing you might be able to do is add a sort of "wait" command to Selenium, or whatever shell command you are using to fire up the system.