Enabling javascript in IE - javascript

I am facing some problems in my web application I have some hidden fields, when I press f12 it will open developer tools and hidden fields are visible there, so I disabled the f12 using some javascript code snippet. But in IE if ithe javascript is not enabled then again same issue will happen.
So is there any way to enable the javascript in IE without manual settings(any programmatic way)?

You cannot enable JavaScript in any browser programmatically. That would be just stupid thing to exist.
Think about you browsing to some malicious site filled with harmful JavaScript - even though you have set your JavaScript off in your browser to prevent the harmful scripts, the malicious site could programmatically enable it again.

No thats not possible but
you could load your form-fields with some ajax
so if theres no js, the form fields are simply not there.
But that also means, that if theres no js, you dont have your correct form.
And do you really only want ie-f12-users not to see your form-fields ? what if someone uses firefox or chrome inspectors ... or just opens the source-code ? i dont get it

Related

Chrome disabled javascript and doesn't allow to enable it

I am not able to enable javascript in Chrome. Under Chrome javascript setting the default option for "sites can use javascript" is grayed out. Even if I add website manually under "Allowed to use javascript" the website is not loading, screenshot below.
This happened while I was trying to find a solution for another issue and followed solution from this page (the top answer), so I went to Chrome Devtools > Sources and clicked on the pause button since then the javascript has got disabled. Paused in debugger in chrome?
Note: Javascript is working fine in other Chrome Profiles. The issue is with this particular Chrome Profile.
Try right-clicking the "Sites can use Javascript" option, and inspect element:
Then, remove the disabled or disabled="" attribute from whatever element the console brings you to.
The option should be enabled. Click it and try reloading your site again.
If this doesn't work, you can try reporting any problems for whatever chrome has (I use Mozilla Firefox and I know they have a help center).
Or try re-installing the browser, because some files may be corrupt (don't worry, if you have an account you can sign-in after the reinstallation and everything should be synced).

Chrome - Disable javascript without reload?

Chrome, as well as a number of extensions enable you to disable javascript so on your page, but all of them force some type of reload to the page.
I am trying to diagnose a poor scrolling performance issue. I would like to have JS enabled while the content loads and initiates, and then disable it altogether, to check whether the issue is script-based or it's just the heavy page content that's causing the issue.
Is there any way to do this?
You can use the Devtools Command menu to "Disable Javascript" and "Enable Javascript". This was demonstrated recently by Kayce's answer to How to disable javascript in chrome developer tools.

How to disable FuckAdBlock

so most of you must be using the AdBlock or AdBlock Plus plugin in your browsers to stop the annoying ads and popups from getting displayed.
But now some devs have developed a script FuckAdBlock that helps the site owner to detect whether I have AdBlock or AdBlock Plus on my browser or not.
My question is how can I disable this script.
I had few ideas that I tried but didn't get anywhere.
From the chome dev tools -> Source, I copied the link address of the script and added to blocked address in AdBlock Plus. Still the file is being loaded. Don't know why.
This script is adding
if(window.fuckAdBlock === undefined) {
window.fuckAdBlock = new FuckAdBlock({
checkOnLoad: true,
resetOnEnd: true
});
}
So I wanted to add an Object.observe on window.fuckAdBlock, so that whenever it got changed I can change it back to null. But unfortunately I don't know how to use it properly.
At last I disabled the JS on that particular site. It disabled the plugin but also some other functionality also.
Somebody already solved the problem here. The script is quite short (103 lines). It works by changing some values in the FuckAdBlock script.
I wonder when the FuckFuckFuckAdblock script will be written though.

Regarding chrome fullscreen message disable

I need to disable fullscreen message ("you've gone fullscreen") coming on the top when chrome fullscreen mode is activated .
i need to do it through javascript . but it's one of the default functionality of chrome.
can any one help me out ?
It's not possible. As you pointed you it's one of the default functionality of chrome.
and I agree with the comment by mic You can't it's there for security
That message is, if you it can be disabled at all, likely a user preference. I have had my fair share of changing that kind of things for a custom "layer" over windows with an integrated browser and I can tell you it's impossible with javascript without some listener app. We created a C# listener app for that kind of thing that keeps checking a certain text file. We made javascript edit the text file and then let C# work it's hacking magic in some of the user's settings.
You could take a look at Chromium, the stripped down version of Chrome, if that would be of any help ;)
ps: To all the people going mental over changing user settings like that, our customers were old people that were unable to use a computer, and our application's purpose was to do as much as possible for them.
You cannot possibly do that as suggested by these links.
https://superuser.com/questions/398945/disable-the-youve-gone-full-screen-notification-in-chrome
https://groups.google.com/forum/#!topic/chromebook-central/h1crbhOy-7U
On the other note, why exactly would you want to do that?

How to modify javascript code at run time?

Is there a way to modify JavaScript code while debugging? Visual Studio has "Edit and Continue", and similar hot swapping of code can be done in Java and other languages. Can this be done with JavaScript, and if so, how?
Chrome, Safari, and some other WebKit-based browsers contain a feature in the Web Inspector known as Live Edit. If you go to the Scripts panel and are stopped on a breakpoint (or maybe even if not stopped on a breakpoint — I'm not sure), you can double click on a line and start editing that line. The changes you make will take effect on the script.
With Chrome Developer tools, this is super easy.
Just pop open inspector, click on the scripts tab, select which one you want from the dropdown menu and then you are free to edit the script and add in breakpoints. If you refresh the page, your breakpoints will stay there.
If you watch this talk but Paul Irish, he shows how you can edit a script on the fly
http://paulirish.com/2011/a-re-introduction-to-the-chrome-developer-tools/
also good:
http://blip.tv/jsconf/jsconf2011-paul-irish-5382827
If you're talking about while debugging, it's very easy to modify the running code. In your debugging console, you can enter in Javascript expressions and it will run in the context of the window, which contains all the objects and functions of your code, so you can swap them out by redefining them.
Because JavaScript can modify the DOM the you essentially have to change the JavaScript file, save it and reload. For me, I like IE so I run the webpage in a browser NOT IN DEBUG mode. Then you can change the script files, SAVE them. switch back to the browser and reload (F5) to see your changes. Supposedly IE 11 has this ability (probably like Chrome which is essentially what I am doing, changing saving reloading from what I can tell) but I can't get it to find, let alone open a js file. Super poor UI. I'm guessing the browser to open the file icon is but it is always grayed out.

Categories