How DO I disable minimize, maximize button in the browser? - javascript

'm trying to make an application for chrome and I have the manifest file background.js and then the window.html. I'm trying to disable/remove the maximize/minimize button where it says x on the top of the right hand side of the page but I'm doing it for a chrome application . How do I disable it so people cant change the size of it? Code is needed tried looking for code and myself but couldn't find anything. Would be amazing if you could I know stack overflow is see code and get better code but I don't know any code for this please help me I'm desperate! thanks!

This is a browser limitation - you can't do this. Malicious actions like these are disabled by browsers.
However, you can open a window without a toolbar or menubar:
window.open("mypage.html","mywindowname", "toolbar=no,menubar=no");
Check out this reference for more information on window.open.

Related

Detect Chrome Extension background page console opened

Just like the title says, I'm wondering whether it's possible to detect when I click on "Background Page" for my test plugin on the "chrome://extensions/" page.
Right now when I open the background page, the console is undocked. I saw this post and found ways to make it work inside each content script. But is there a way to make the plugin detect it's own console opening?
This function from that post inside my background.js doesn't seem to detect anything.
chrome.tabs.query({url:'chrome-devtools://*/*'}, function(tabs){
if (tabs.length > 0){
console.log('opened');
}
});
Any advice would be highly appreciated.
Devtools windows are not visible to tabs/windows APIs anymore.
This has changed since the answer from '14 was posted - therefore this method no longer applies.
Unfortunately, I can't find a link to the Chromium issue that implemented that.

Is there a way to force links to open in external browser instead of Facebook in-app-browser?

I think I already know the answer - "no"!
Basically the facebook in-app-browser has some bugs on various platforms and I want to show a button that enables user to open in external browser. But sounds like it is not possible from reading previous answers.
This sucks, does anyone have a workaround?
The app decides how to open links so you cant force it to use an external browser through your code. It can be changed in the app settings but that won't help you.
You can try to detect the Facebook browser through the user-agent and then throw a popup or something like that asking the user to click the 3 dots at the top right and then "open with chrome" or whatever the iPhone equivalent is.

Firebug Lite on Chrome causes Footer Issue, is there a fix?

I'm a Chrome user and would be lost without Firebug, but one issue has always annoyed me. Namely, the fact that the Firebug console doesn't appear below the site you're viewing (ie the way it behaves in Firefox). Instead, the console sits above the site, obscuring the footer and content. It's a little thing but annoying all the same.
I understand that this is because of the way Google restricts Chrome extensions but is there a way around this particular issue?
I haven't found a solution anywhere. So, with some help from other stack overflow threads, I came up with a very simple function and as I couldn't find much about this, I thought I'd post it here for anyone with the issue.
I'm not a JavaScript programmer, but I do use jQuery. As such, I run this inside jQuery's ready method. Once the site has loaded, it'll check to see if Fire bug is open, if so, it simply adds a 400px bottom margin to the body. Obviously, if your console is bigger/small than that, just change the size inside the jQuery code.
It won't however change anything if you open the site and then open Firebug. It's nothing major, just open Firebug then refresh the page an it'll work.
// add body margin if firebug is open
if (console.log.toString().indexOf('apply') != -1 && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
$('body').css('margin-bottom', '400px');
}
Hopefully this will be of use to somebody.
EDIT:
WARNING: This can possibly cause your jQuery to stop working in Internet Explorer. So, just remove this if you find that your jQuery doesn't work.
Instead of modifying your webpage's CSS code which may have adverse effects, you should just detach Firebug Lite in Chrome, then position that popup window under the resized Chrome browser window.
To perform this, just press the center button in the Firebug Lite window located at the top right corner.
Right-click the image below and view in full size if that helps:
Open Image in New Tab / View Image
This way, you'll have two separate areas that don't overlap yet play nicely together.
Per Stan's comment above... about what does Firebug Lite provide extra when compared to native Chrome's Developer Tools, I would have to say it provides familiarity and a great DOM Tab that Chrome lacks.
More importantly thought, you can actually use BOTH consoles at the same time.
This allows easier monitoring of two different panes and with a multi-monitor setup this can be a useful scenario. Even with a large monitor things look good.
Right-click the image below and view in full size if that helps:
Open Image in New Tab / View Image

Google Chrome JavaScript debugging line by line

I am trying to follow the guide here:
https://developers.google.com/chrome-developer-tools/docs/scripts-breakpoints
But it doesn't seem to work, i.e.
I have done the following:
Open the Developer Tools by hitting the Control-Shift-I shortcut
Open Scripts panel and select "script.js" from scripts drop-down
Set breakpoint on line 19 by clicking the line gutter (you can use the Control-G shortcut to reveal a line in a large file)
Move your mouse over this page
You should stop on the breakpoint
Nothing happens when I hover over "this page", and it doesn't stop at the breakpoint when I hver over "this page"...
What is going on?
I need to good way to debug javascript/jquery code
If you hover over the second screenshot on the page, it work as expected.
If this doesn't work, please try another page, as I use the chrome debugging tools quite often and I have never had a problem with it.

Disable & resize IE

I have a few questions in mind...
I want to disable right click on my webpage so that noone can alter
the source code
I want to disable the addressBar as well
I wish to resize it to a particular size in the bottom right of my
screen & with a text area so that when ever I click the button
inside that webpage all the contents in that text box should be
copied
I tried experimenting but it doesn't seem to work, javascript maybe has some issues.
I wan't it purely on javascript & HTML (Can't use php/asp), want it to work on IE only, dont care about other browsers....
1) I wasnt to dis able right click on my webpage so that no one can
alter the source code
Regardless of browser hackery employed, the user will always be able to view your source. Nobody will ever be able to alter the source code on your server (short of the server being hacked or a vulnerability in your code is found). But, using Firebug (or similar), anyone can change client-side script, CSS and/or HTML.
2)I want to disable the addressBar as well
You can't just gain full access of a browser. That would get annoying pretty quickly (think about the potential browser-inducing epilepsy if every site had control over your root browser and did different things to it). One thing that you could do is have your site create a popup window that is set to a specific size with specific attributes (hiding the address bar, etc). Note that you may annoy users with this as you'll have to deal with popup blockers and such.
3)I wish to resize it to a particular size in the bottom right of my
screen & with a text area so that when ever I click the button inside
that webpage all the contents in that text box should be copied
I have no idea what this means.
Was this post a troll?
You can't disable the address bar with JavaScript.
However you can disable right click. Note: Anyone with enough technical background to know what to do with the source code would know enough to just disable JavaScript to get their right click working.
Here's a demo with source code to disable right click.
Demian's answer has some good insight on what you're asking, I strongly suggest you rethink what you're doing.

Categories

Resources