JetBrains PhpStorm 2018.2: Error while fetching external resource (xmlns, schemaLocation, xsd) - xsd

I want to use autocompletion at my typo3 fluid templates for some viewhelpers i.e. vhs, but PhpStorm could not fetch the external resource. It only works, if I download the xsd schema file and "manually setup external resource". It would be very nice, If the program could do this.
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
v:schemaLocation="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers https://fluidtypo3.org/schemas/vhs-master.xsd">
<!-- my code -->
</div>

Not sure why your schemaLocation doesn't work, but try replacing the XSD URL with one you get from https://viewhelpers.fluidtypo3.org/ and re-download the schema from there. You'll have to pick a specific version, though.
The schemas there are generated fresh with a couple of fixes to the XML source they contain. Nothing that I expect would affect the download.
One thing though - both those URLs are served with a multi-hostname SSL certificate which means the version of openSSL you use must be at least I think it was 0.94.4 in order to be compatible. If your OS is very old it might help to update the openSSL library or do an OS update. But in all cases it should work if you use a browser to download since all current browsers understand SNI.

Related

For Chrome extension publishing purposes, does using a Bootstrap CDN count as remote code?

I am trying to publish a Google Chrome Extension. Before doing it, there is a form to fill:
I am unsure about how to answer. The extension does use a bootstrap CDN via:
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
On the side it says:
Remote code is any JS, Wasm, or CSS that is not included in the extension's package. This includes references to external files in tags, modules pointing to external files, and strings evaluated through eval()
Is this CDN use considered as remote code? Is it considered a module pointing to an external file?
Yes, remote code would include CSS files served by a CDN. There are various areas in the Chrome Extensions documentation that specifically define remote code as any code not bundled in your extension. They even include "Any library hosted on a CDN". In fact, they actually specifically reference Bootstrap on the Remotely hosted code restrictions page.
Although CSS is not something blocked by the new Manifest V3 restrictions on remote code, including remote code can make the review process take longer. Instead, it's better to include the library bundled with the extension (assuming the library's license allows it).

How to check current browser against the list of supported ones

We have a list of browsers we test our webapp in. I have a task to notify the user if his browser isn't supported or tested to work well with our app.
We have a browserslist configuration in the project and I'm looking for a way to test current browser against the list.
I tried browserlist-useragent but we can't compile it with webpack due to the fact it uses net, fs, tls and other native node modules we don't want to include in our bundle.
Is there any better way do avoid copying the list of supported browsers in many different places and just use browserlist configuration that already exists to detect if user uses supported one or not?
I'd consider using this "utility" package https://github.com/browserslist/browserslist-useragent-regexp in the project that uses browserslist, and then use the file generated by the script suggested by this package to then use anywhere else.
In reality, all you want is the regex in the generated file. This can be placed in any client or server code you need for browser detection. I've placed mine in some classic asp.
Also note that on a Windows PC, the instructions provided don't result in a file containing a RegEx. Instead, you'd need to run npx browserslist-useragent-regexp --allowHigherVersions to display a suitable RegEx on your console, and then add that where needed.

What does this error message mean

Hi I just want know what this error message means
Denying load of chrome-extension://cmbbgcooaabknohabmoaikiakkoignai/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
It means one of your Chrome extensions is using a compressed version of jQuery which contains a sourceMappingURL comment, and the extension's developer is most likely unaware of that.
Source mapping is used for debugging purposes, failing to load a map file won't affect the script's execution.
It is also worth noting that newer versions of jQuery no longer contain the sourceMappingURL comment by default. From the jQuery 1.11 and 2.1 release announcement:
Sourcemap changes
This release does not contain the sourcemap comment in the minified
file. Sourcemaps have proven to be a very problematic and puzzling
thing to developers, spawning hundreds of confused developers on
forums like StackOverflow and causing some to think jQuery itself was
broken.
As an user, you can safely ignore that error. The browser will only attempt to load the map file when DevTools is opened (and has the "JS source maps" DevTools setting enabled). If it fails to load the map file, nothing changes.
As a developer, you can remove that error message by either upgrading to the latest jQuery version, or manually remove the sourceMappingURL comment from the compressed file, or, if you want to use source mapping, make the map and uncompressed js files available. See this related thread as well.

Orchard 1.8 'shapeTracingMetadataHost is not defined'

I am trying to play with some of the designer tools for Orchard 1.8 to understand how some of the overall architecture works, but when I enable the Shape Tracing module I get a ton of these: Uncaught ReferenceError: shapeTracingMetadataHost is not defined.
The HTML seems to be generated for some of it so I can poke through there in trying to figure out layout processes, but any suggestions on what might cause this? It does seem to work with The Theme Machine which uses jQuery 1.9.1, however we're using the latest jQuery (via <script src="//code.jquery.com/jquery-latest.js"></script> so is that potentially the source of this?
Do not bring the latest jQuery. Always use Script.Require("jQuery"). jQuery is a shared resource. Let the platform decide which version to use. Not doing so means that you'll get multiple versions of the same script included, and any breaking change in jQuery (and those are common) will break random things.

JSF xmlns URI not registered in IntelliJ IDEA

Here is the start of my JSF file:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
</h:head>
<h:body>
However, http://www.icefaces.org/icefaces/components and http://java.sun.com/jsp/jstl/core are highlighted in red with error URI is not registered. This causes many other subsequent tags to appear in red with errors element 'x' is not allowed here. Here is an image showing what I mean:
Attempted solutions:
When searching for a solution, it appeared some others with the same problem solved it by doing "Fetch External Resource". However, this didn't work for me. For the icefaces xmlns xmlns:ace="http://www.icefaces.org/icefaces/components" I get the error: Error while fetching http://www.icefaces.org/icefaces/components. And for the jstl xmlns xmlns:c="http://java.sun.com/jsp/jstl/core" I get the error: No XML at the location: http://java.sun.com/jsp/jstl/core.
I also found some people solved it by deleting the IntelliJ IDEA metadata file workspace.xml in the .idea directory. This does seem to work temporarily... but then it seems the problem comes back after a while. I also have to reconfigure several project settings which I would like to avoid.
Any help would be appreciated.. I'm not really familiar with the xmlns stuff and still a beginner to web app development. Thank you!
Update:
As per Mark Vedder's answer, I manually added external resources to my project and the problem has not resurfaced thus far.
With unregistered resources, the first solution is to use the "Fetch External Resource" quickfix. If that fails, as it has for you in this case, (usually because the "location" is in name only) you need to manually configure it.
To Manually Configure
If the resource (i.e. the .xsd, .dtd, etc.) exists in one of your library jars, skip to step 2. Otherwise, download a copy of the resource. Put it somewhere convenient on your system.
In IDEA, with your cursor on the error, open the Quick Fix / Intentions menu by typing Alt+Enter and select "Manually Setup External Resource". (If you do not have this option (based on IntelliJ IDEA version) go to the next section for instructions.)
If the resource is in a jar, select the Schemas tab and select the resource from the appropriate jar. If you downloaded it, select the Explorer tab (may be named Finder in Mac) and navigate to and select the file you downloaded.
Click OK and let IDEA index the resource.
To Edit or Set via IDE Settings
Open the settings Dialog via Ctrl+Alt+Enter or File > Settings.
To configure for all future new projects so this schema is avaiable, open the similar dialog via File > Other Settings > Default Settings
In the Project Settings section, find the Schemas and DTDs node.
Configure the desired schema. There are add, edit and delete icons in the upper right. Like above, you can select a file within a library via the Schemas tab, or your file system via the Explorer tab.
UPDATE
The various JSF Taglib definitions (for JSF 2.x and above) can be found in the com/sun/faces/metadata/taglib directory of the com.sun.faces:jsf-impl jar. The jsf-impl JAR file can be downloaded from maven central among other places.
A probable issue could be that the "Java EE: Java Server Faces" plugin is disabled. You can enable it by browsing to
Settings > Plugins and on the Installed tab search for Java Server Faces.
I tried every thing suggested here to get intellij to recognize the correct version of my jsf. At the end I discovered that I didn't have a direct reference in my web project maven dependencies to jsf-api. In other words, adding
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.29-08</version>
<scope>provided</scope>
</dependency>
to my pom, fixed it. The confusing thing is that intellij was able to resolve a subset of the jsf symbols, which makes you think that the jar was being seen by it, albeit a wrong version of the jar.
In IntellijIDEA 2022 we need to add Plugin Jakarta EE: ServerFaces(JSF)
If you are using "IntelliJ Idea", please open the "Project Structure" dialog by clicking Ctrl+Alt+Shift+S, look for the JSF not found in the artifact (some thing like that) error notification, please click the fix it option and change the JSF scope to provided. It fixed my problem.
This error happens when you do not attach the library of JSF Mojarro. Download and add that library in the project.
File> Project Structure> Library
add JSF the library.
I was having same issue with icefaces resources.
One way to fix this is to give the project (again, if you already did not) the IceFaces framework support (right click on project name).
In my case I was using 3.3.0, then I set download in the Add Framework Support form.
Intellij downloaded 3.1.0 and the IDE recognizes the resource immediately after. Later I set again the 3.3.0 version.
So, I think is enough to re download the framework again, and the resources will be downloaded in META-INF folder.
Regards.-
you could also add "urn:import:<url>"
example:
xmlns:d="urn:import:com.mypackage.mylovelycode"
I had the same issue... but in my case, the problem was that by mistake I saved file with extension ".xml". Changing it into ".xhtml" solved the problem

Resources