Bookmarklet requiring a space is corrupted in Chrome - google-chrome

Quite a while ago I created a bookmarklet to save time when opening a trac ticket. It looks like this (with the URL portion replaced with trac.example.com/example:
javascript:(function(){var nbr=prompt('ticket','number');f='https://trac.example.com/example/ticket/'+nbr;if(!isNaN(nbr)&&nbr>0&&!window.open(f)){location.href=f;}})()
This worked well for quite a while in both Chrome and Firefox. Then they both stopped working. I discovered that the problem was the space between "var nbr". I replaced the space with %20, and the bookmarklet both in Chrome and Firefox again worked.
However recently Chrome insists on removing the %20 and replacing it with a space, and the bookmarklet does not work. The bookmarklet in Firefox continues to happily work with the %20.
I also tried using + instead of %20. But that does not work either, although it does not get turned into a space.
What can be done to have the bookmarklet work in Chrome?

I wasn’t able to reproduce the problem¹ and Chrome didn’t modify the bookmarklet. But in any event, you can remove “var ” from the bookmarklet² because you don’t have to tell JavaScript what nbr’s type is.³
Replace your bookmarklet’s address with:
javascript:(function(){nbr=prompt('ticket','number');f='https://trac.example.com/example/ticket/'+nbr;if(!isNaN(nbr)&&nbr>0&&!window.open(f)){location.href=f;}})()
Testing on Chrome and Safari and entering 123 opened a new window and sent me to https://trac.example.com/example/ticket/123. Entering nothing at all – or the default text string number – closed the prompt window and nothing happened.
var , including the space immediately following it. Or var+ or var%20.
Similarly, the bookmarklet initializes f without declaring var f.

Related

code tag shows XML markup then disappears in Chrome

The below URL shows some XML in a <code> tag. It works fine in say Edge and Firefox but in Chrome, the markeup shows for a second then disappears just leaving the values as you can see below. Why is this happening in Chrome?
https://basketball.exposureevents.com/api/resources/venues
First, try hard refresh, it's simple thing that may solve the problem (if the source of it is in the specific site's CSS/JS code) (Windows: Ctrl+F5, Mac: Cmd+Shift+R)
Second, try update you'r Chrome to the last version (70.0.3538.67), go to on the top bar, there you can see if there is a new update (if there is, it will show up at the first line).
You can check you'r Chrome's version in this link: chrome://settings/help or go to on the top bar > Help > About Google Chrome.
If you'r Chrome is up to date, you may have some plugin/s that removing the xml tags.
Try accessing to this page via Incognito Mode (Windows: Ctrl+Shift+N, Mac: Cmd+Shift+N).
If it's working in the Incognito Mode, back to you'r main Chrome and then click on on the top bar > More tools > Extensions. Then, disable all of them and try to enable them one-by-one, on each one you'r enabled, go and check again if the problem is still there.
*Note that some plugins may be enabled also for Incognito Mode, so try the last step anyway.
Update: As much as I understand, the root issue is that your code was wrapped with html <pre> tag, that makes the browser to treat the XML as HTML tags, that are invisible when rendered in browser.

Figwheel working on Firefox but not on Chrome

The same application that I am developing works fine on Firefox but not on Chrome.
My application a day ago printed some things on the console, but I removed them today, which means that the actualized version of the application does not print anything on the console.
On Firefox it works, everything renders and there is not prints on the console.
However on Chrome, the app still prints on the console. It means that it is retaining some old state for some reason.
Does that even make sense? The code is already gone (erased), so the only way Chrome is printing the old state on the console is if he is storing it.
On Chrome I also get errors of undefined functions, but they are defined. On Firefox that does not happen.
Have you tried reloading the page? Another thing to try to really get rid of the state that the browser is obviously holding onto is to clear the browser cache.

Webpage displayed in Incognito, not in regular Chrome

So i have been running into this problem with a lot of Wordpress sites lately, usually occurring when i am logged in as Admin, so i couldn't post here because no one would be able to view the problem. However, i just found a site that it happens on that doesn't require admin creds.
http://www.otisports.com/
When i visit this site in Chrome (Version 34.0.1847.137 m), it just displays a blank page. No errors, just the (what now seems standard) event.returnValue is deprecated. Please use the standard event.preventDefault() instead. warning. I have seen that warning signify problems on the site, but they are usually minor, not to the extent that the above URL displays. However, if i open an Incognito window and visit the site everything works perfectly and there is no warning. Does the Incognito window deal with webpages in a way that is so entirely different that it would cause something like this to happen?
I have been racking my brain trying to figure this out. Can anyone reproduce this? is it a bug in chrome?
EDIT: I just tried to open a bounty on this question and the EXACT same thing happened. In Regular Chrome, nothing happened when i clicked the start a bounty link and i saw various errors Undefined is not a function however in incognito everything worked perfectly. what gives?!
EDIT: Yes, i have cleared the cache, history, cookies, everything, and i still get the same errors. I cant even post a comment on this question because of errors...
I came across the same issue when trying to open evernote.com. It loaded successfully while using incognito mode in chrome. Let me share how I fixed this even though the original post is way too old. But maybe someone can find it useful.
I'm using chrome (Version 73.0.3683.103 (Official Build) (64-bit)) running on Linux Ubuntu 18.04.2 LTS.
I tried disabling all extensions and clearing browser data/cache but nothing worked. PS: Disabling adblock previously worked for me. Yes, I stumbled over the same issue before and whitelisting evernote in adblock solved the issue. But it didn't now.
The following is what worked for me:
Open developers tools (CTRL + SHIFT + J).
Navigate to Applications tab.
Choose Clear storage from the side menu
Hit Clear site data button.
After reading the comments I dug into chrome and saw there was a bunch of extensions still sitting around that were definitely malware and I thought I had previously deleted. Instead of picking through them one-by-one, I just deleted everything, re-installed Chrome, and now everything works great!
I had the same issue. My application was working in Incognito mode and in Firefox but not in Regular Chrome. I even disabled all the extensions but no luck. I eventually cleared the Cached images and files because on developer console I found out that the regular chrome was still picking up the old file due to caching. So as soon as I cleared it, my app showed up like a rocket :)
Try removing any non required extension .
Specifically AdBlock
I resolved the problem post that.
Since on Incognito , extensions are disabled, hence page run as expected.
I resolved this unforeseen issue using following steps.
CTRL + SHIFT + DEL > Clear Browsing Data.
Cookies and other site data
Cached images and files
This is for Chrome Browser.
Open Console (Ctl+Shift+I) first.
Then under the application tab, you will find some options on the left, find out the application there, you will find it at the top.
There you will find Service Workers.
Under Service Workers, there will be three checkboxes. Select Update on reload checkbox and reload again.
I had the same issue after installing React-Sight Extention.
The Page hanged but not in the incognito mode.
Try deleting any recently added or junk extension.
Delete your cache.
That worked for me
I had a similar issue in chrome, in my case the problem was that I could log in to my university library's website only in incognito mode. After some digging, I figured out that Google Translate extension was set to automatically translate any page. When I turned that off and instead selected never translate that specific page, it started working in the usual mode as well.
This is rather an old issue but still happens. None of the solutions recommended here and there did not solve the issue in my case.
I somehow noticed this is related with a -some kind of- corruption on the user profile.
This is how I solved it:
Close all Chrome browsers.
Open a Google page on Chrome.
Sign-out from Google (rigt click your profile picture on a Google page, not on the Chrome itself), and sign-in.
If this doesn't work:
Close all Chrome browsers.
Right click Chrome icon and select Google Chrome.
Delete your Google profile on the "select your profile" page.
Close Chrome.
Open Chrome, sign-in.
uBlock Origin was the culprit in my case. Once I allowed the site in uBlock Origin, pages loaded correctly in normal Chrome.

Chrome DevTools is ignoring an image with "facebook" in its file name

I was editing some HTML using Chrome DevTools and noticed some weird behavior. When I'm trying to add an image using :
<img class="button" src="images/facebook_hover.jpg" alt="" />
As soon as I enter this snippet, Chrome deletes it all together, as if there's no img element at all. I've tried adding it several times and it I'm getting the same result. However, typing any word instead of facebook in the filename makes the img visible and fully working.
Further more, when I added that code using an external editor, Chrome didn't show that image, while other browsers did.
Google Chrome 29.0.1547.66 m, Windows XP SP3.
The same issue on another computer with Google Chrome 29.0.1547.66 m on Windows 7
But a newer version of Chrome doesn't have this problem.
Any rational explanation?
After a lot of digging, I realized that the issue is caused by "Adblock Plus", somehow it considered every image that has facebook in its filename an advertisement that needs to be blocked. I didn't knew that this extension can interfere with the DevTools too!
The irony is that I'm a contributor to that extension!

How to force Chrome to refresh javascript - none of the existing solutions work

I've tried everything. I've tried ctrl-shift-R. I've tried ctrl-F5. I've checked the Disable Cache box in the developer tools. I've completely cleared my browser cache. But I cannot for the life of me get Chrome (Version 24.0.1312.57 m for Windows 7 - the most up-to-date version) to reload a specific piece of inline javascript (meaning it's in my html page, not in a separate js file.)
Is there any other way I'm missing to get this done, or do I need to completely uninstall Chrome and reload? Please don't tell me to use Firefox instead; the code works in javascript but doesn't in Chrome, and I need to be able to test it there.