WKWebView property "plugInsEnabled": where is it good for? - wkwebview

The WKWebView control has a property plugInsEnabled as part of the preferences of the configuration property of the said control. The documentation states:
A Boolean value indicating whether plug-ins are enabled.
Apparently the documentalist didn't know it either. I can't find any other documentation of this setting.
Does anybody know what this setting exactly does?

Setting plugInsEnabled enables Safari compatible plugins, like Flash and Java, to work within the WKWebView component.

Related

How to highlight elements in a Chrome Extension similar to how DevTools does it?

I'm interested in creating a Chrome Extension which lists all the elements on the webpage that have an 'id' attribute in a menu. Then, when the user clicks on the element in the menu, the corresponding element on the webpage is highlighted.
I saw Chrome devtools highlights an element when you right click and inspect on it. I'm curious if there is some highlighting API accessible from DevTools? If not, how does one highlight elements similar to how devtools does it?
You can use the exact API that Chrome DevTools are using. You will need to call highlightQuad or highlightNode via debugger API. You can even specify the color and you can be certain that the highlight will render correctly and not interfere with the website (injecting an 'overlay' node, as Xan suggested, doesn't guarantee that). On the other hand, it will be much trickier to get right and user won't be able to use both your extension and DevTools at the same time (there can be only one debugger API connection). This code should get you started.
Chrome API does not provide access to such highlighting; you'll need to implement it yourself with an overlay.
Chrome API does provide access to the same functionality as DevTools if you use the debugger API. See this answer for details.
Before Chrome 63 (2017-12-06), writing a DevTools extension (i.e. using devtools.* APIs to display UI in DevTools) and using debugger at the same time would've been impossible, as only one instance of a debugger protocol client was allowed at once. This has changed, so now it's a viable answer, even if the documentation for chrome.debugger API wasn't updated yet.
Even though it's now possible, be aware that debugger API is an API with heavy warnings (adding it after publication may auto-disable installed extensions - needs testing).
Below is the original answer:
You can implement the highlighting yourself with an overlay.
You can study how it's usually done by looking, for example, at the element picker of uBlock Origin.
In short, that method creates an SVG overlay using, among other things, getBoundingClientRect() of the elements selected.

What does input_components do in a Chrome extension manifest?

In the Chrome extensions documentation page for manifest.json, there is an undocumented setting called input_components. What does it do?
input_components is part of the (terribly documented) chrome.input.ime API.
If you want to know how it works, see this example and/or read Chromium's source code.

Node-webkit Browser Plugin

Description of the Problem
As NPAPI plugins will be deprecated in Chrome (maybe in Firefox too soon) and being part of a project (WebChimera) that is based on an NPAPI plugin. I've been thinking of different solutions to keep NPAPI support in browsers. (as porting this plugin to NaCL is currently impossible, but the plugin can be used in a frozen version of node-webkit that currently supports NPAPIs)
So I was wondering if it is possible for a browser page to open a node-webkit app on the user's PC, then using JS with/without jQuery to send data about the html element where the Node-Webkit window (with always on top set) should be to the app (maybe through a websocket) to always position it there.
I know I can get a html element's size, position in JavaScript, I also know I can track the scroll of the user and browser tab changes to do the necessary changes to the window size, position and visibility.
The Question
The thing that truly stops me from even attempting this is how would I know when a browser is not fullscreen, and how would I know the browser's position on the screen if it is not fullscreen either from the on page JS or from node-webkit directly. Another thing that should be a concern is what screen is the browser window on.
Am I the only one that has thought of such an endeavor with node-webkit, are there any open source projects attempting this?
Any thoughts or comments on this would be greatly appreciated as a solution to this would not only save NPAPI plugins in the near future but will also open a world where Node-Webkit can also be used as a viable solution to build browser plugins too. :)
This would involve a lot of painful hackery. You'd have to solve most of these issues on all platforms independently and rely on a lot of implementation details.
As a possible alternative, check out the plans for FireBreath 2.0 which will support plugins which can be loaded via NPAPI, ActiveX, and Native Messaging via a new protocol called FireWyrm. Currently there is no drawing support when using the FireWyrm interface and only Native Messaging is supported. Additionally it's not quite finished, though I'm getting close =]
Now it's possible to use libvlc to play video directly on NW.js/Electron page: https://www.npmjs.com/package/webchimera.js
What this project is: it's low level (written in C++) addon which use libvlc and allow decode video frames to JS ArrayBuffer object. In turn this ArrayBuffer object could be drawn on HTML5 canvas directly or with WebGL. This project use Node.js/V8 API directly and not use NPAPI at all, so will live even after NPAPI deprecation. Another good thing - perfomance of this (espesially if use WebGL) is comparable with original VLC player perfomance.
Simple usage example available at: https://github.com/jaruba/wcjs-player

Offer to change the default search engine for the omnibar

I'm looking to offer the user (inside my Chrome Extension) the option to change their Omnibox default search engine.
Sadly, I've been unable to find any documentation on how to do something like this. Has anyone does this before successfully?
Actually with new versions of chrome it's possible through chrome API via settings_override section. But for now it's working only on windows.
Not possible, sadly. See this bug filed in Chromium

Is there any way to get access to Chrome's theme favicons?

I would like to use Chrome's default favicons.
For example (you can simply open them in Chrome):
chrome://theme/IDR_HISTORY_FAVICON
chrome://theme/IDR_EXTENSIONS_FAVICON
chrome://theme/IDR_SETTINGS_FAVICON
chrome://theme/IDR_PRODUCT_LOGO_16
When I used it as an image source nothing happened. Maybe Chrome blocked the access to the icons or this was not the proper way to use the icons. I tried to use "chrome://favicon/", but it didn't work with Extensions and Settings (strange, but it worked with History).
How can I use the built-in favicons as an image?
I would be also grateful if you could get me a full list of the Chrome's favicons, it must be in Chromium's source code, but I have no idea where to look.
(I'm using Chrome 19.0.1084.52)

Resources