I have also asked this question here at the chromium Google group.
I would like to be able to keep a context menu open even after a user checks, or unchecks, a checkbox. My plugin allows users to check which devices they are using when testing and when testing multiple devices, it is frustrating to open the context menu several times to tick each device.
Does anyone know of a way to do this? It does not seem to be supported natively. I don't really want to use some magic to re-open the menu, if possible, after a user checks a given device, hence the question here. If it is the best (yet hacky) way, then fair enough. I hope it's not! I think menu flickering would also look bad.
No, there is nothing in the API to allow that.
It might be an interesting feature request - if you're willing to spend time to formulate it at https://crbug.com/
Related
I'm trying to trigger the "Desktop site" (and additionally know if it's already triggered) you can have on your mobile browser from JavaScript, is there a way to do that?
I saw some others topics that had the same issues but on their sides they were more about having a custom view for both or something along this way, while on my side I would just want to trigger this specific feature
(this is a comment, but its a bit long)
Upvoted here because although you are asking the wrong question, what sits behind that question is an interesting problem and not well documented.
The menu entry asserts some behaviour which is sent to the backend server. The backend server then delivers different content. For security reasons, a web page can interact with browser chrome (i.e. the furniture outside the view of the website in the window). So the answer to the question you asked, is that you cannot invoke this from javascript. However your problem is not invoking a menu item but rather creating the same effect as invoking the menu item.
Providing a toggle to change the presentation layer on the website is straightforward, however the question should really be,
How does this menu option change the behaviour of the site?
How to implement/integrate a parallel mechanism for achieving the same result.
I caught myself wanting to make a cross-tab sound controller and i have done some research on this, but i can't really find a good way to go about controlling the sound for all elements in all open tabs.
Does anyone know of any way with jq, js, or anything else that can run in a browser that can be used to controll the volume of all open (and new) tabs?
The use-case would eks be muting all tabs with one button, adjusting up or down the total "browser volume" in one place, and such.
I haven't been able to find any support for this so far, so does that mean it really is impossible after all?
Edit:
The main thing is that this needs to be "cross-tab" and not just a way to adjust a single audio player / audio source playing in a single tab. Say you have 5 tabs with Youtube open and i want to be able to mute / lower volume / raise volume of all those tabs from one single tab.
It depends what you mean by "In the browser". I think that you will only really be able to accomplish this as a browser plug-in or extension. That may not be what you're looking for, but browser extensions can implement that functionality.
See: https://developer.chrome.com/extensions/samples and look at the chrome sounds sample. That might give you a good place to start.
I did find a solution for lowering the volume on one given tab. You could simply repeat it for each tab.
Check this please: Javascript: control Google Chrome's open tab audio volume control
I have a few Facebook groups and pages and they all work fine with sharing whatever I want. But on my main page (last 24 hrs), whenever I try to share something, all that happens is the share box pops up for a millisecond (no text) and simply vanishes.
I’ve tried it in both Chrome and Firefox, and on different computers, cleared caches, the lot; same result. It’s a fully public page too, so it’s not a security issue, I would think.
At the moment, the only way I’m able to get a rough idea what’s going on, is using Chrome’s right click → inspect element, or Firefox’es similar function. I’m not sure what I am looking for though, and I presume there is better software to debug things like this.
What software or plugins do you need to see what the code is actually doing as it executes? And hopefully highlight hangup points or show me where the issue likely is.
If this is an issue with Facebook products and not an issue with platform, the best way to highlight this issue is to file a bug report using Facebook's Report form (https://www.facebook.com/help/326603310765065/). It is highly likely that this is a known issue that engineers are working on, but it doesn't hurt to report the bug.
I'm trying to find an elegant way to inform a user that s/he is about to be logged out and I know that most browsers will give you some indication that a hidden tab has an alert box open. I would like to duplicate this functionality without actually showing an alert box.
I have thought about forcing the tab/window to gain focus, but that is quite obtrusive and I hate it when websites do that to me, so I'm looking for something a little more subtle.
Any ideas?
Edit/Clarification: I already have a div that pops up if they are about to be logged out. My problem is that if they are on another tab, they won't be able to see that div, so I would like some way to notify the user that something important has happened on my tab so they go check it out and see the logout notice.
The favicon idea listed below is an excellent idea, any others?
Here's an interesting way that comes to mind. When its time to be logged out, change the website's favicon dynamically. Newer browsers should be ok with it.
Look here: Changing website favicon dynamically
Some techniques I've seen:
Some sort of sound that's played (I think it's done with Flash in the case I'm thinking of, but maybe it's possible with HTML5's audio tag)
Flashing/alternating favicon
Use JavaScript to change the page title tag every 2s or so
You could create a page that informs them they will be logged out in a certain amount of time with a button that would allow them to maintain their session. Or maybe you could use a lightbox modal popup window (example here).
Why not swap out a div styled how you want to change to let them know they will be logged out soon? Then, you can simply have it as a portion of your page with all the same style and formatting?
For example, your normal page has some sort of page element with visibility:block; and then before they will be logged out, you change that to visibility:none; and change your other element (in the same place) to have visibility:block;
Does this idea make sense? You have to be able to detect when this is happening with Javascript already to alert, so instead of altering you are just swapping out display elements.
I hope this is helpful,
-Brian J. Stinar-
it probably doesn't go with what you're after but a simple modal window is probably a good idea? i know it doesn't alert the user instantly, and they won't see it unless they switch back to that tab, but it's unobtrusive and i believe most users would prefer not to have something rammed in their face!
If this notification is to be triggered by a user clicking "log out" or the likes then they will see it and it won't be as intrusive as forcing them to stop what they are doing and close the alert box.
And if it's due to time out or something similar then the user isn't overly concedrned or they would still be on that tab.
I think that this serves the best purpose in terms of usability as people don't want to be hassled or have their workflow broken by an alert shoved at them! A perfect example is Microsoft TFS which would constantly throw alerts at you when you got signed out, which got really frustrating, really quickly
so my answer is think how the user would like to be notified in the least obtrusive way :-)
i search online but can't get satisfactory result
i want to protect images on my website, i know i can disable save as, right click.
the real question is can we Disable Clipboard & Print Screen with JQUERY or java script.
so no image copy from print screen.
thanks
Not from a webpage.
Even if you were able to disable these from within a browser, it will only stop a casual user. If you make a resource available on a public server (as you must in order to let a casual user view it), there really is no way to stop someone from retrieving that resource. After all, you actually want the user to retrieve the resource.
No. I am pretty sure you can't do that. Print screen is a part of the OS, not the browser. I would hope that web sites weren't able to mess with my OS like that.
You can certainly throw roadblocks in front of people trying to download an image, but short of watermarking, there isn't a great way to prevent people from getting your image (that I know of) if you make it available online.
No you can´t. And you can´t disable right click in a bullet proof way either.
The only way to protect your images is by watermark them.
Print Screen is a function of the operating system, and as such, cannot be disable by a webpage.
Actually, you can't disable anything. I know you technically can, but most browsers have an option to not allow disabling of those things. And really, worst case scenario, anyone can view the source of your site and copy the image's url.
In short, don't worry about it so much. Some people will copy your images, but this is nothing new on the internet, so you'll just have to learn to live with it. The only thing that any of your work will do is annoy some people, and make other people have to try a little bit. So, it's really best to not do anything. Place a copyright notice on your site and most people won't try to blatantly steal from you.
The only way to do what you're requesting is to incorporate OS-embedded DRM into your content (think HDCP). This can prevent even screenshots from being done but will severely limit your audience and is an absolutely horrible idea - don't do it!
If you really want to protect your images, the best way to do it is with watermarks and providing very low-quality images on your website and the high-quality stuff in some other way. The watermarks aren't a perfect solution but many consider them good enough.
Well there is no direct way to do that, but I used javascript to hide the content whenever the user hovers outside the website. This forces the user to actually activate your page to be able to see its content. This will activate the javascript that prevents prnt scrn too.