Open Graph namespace declaration and Accelerated Mobile Page (AMP) Validation - facebook-opengraph

I'm updating my site to AMP but by the time I try to validate I get the following error:
The attribute 'prefix' may not appear in tag 'head'
And the OG namespace declaration uses prefix, how can I workaround this issue?

Facebook sharing doesn't require the prefix attribute. So an easy workaround is to simply omit the prefix attribute. This is how ampbyexample.com does it and it still works:
https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fampbyexample.com
Nevertheless, the AMP validator should support the prefix attribute. I've filed an issue here.

Related

Is there a way to get Content Security Policy 2 to work with Google Tag Manager?

I added the Content-Security-Policy header to our servers' responses, but the browser throws errors when Google Tag Manager (GTM) injects Custom HTML tags.
CSP3 has 'strict-dynamic' which appears custom-made for GTM, but currently only Chrome supports it, and CSP3 is a Working Draft.
I wrote code to get the Custom HTML tags via the GTM API, hoping I might take the scripts' hashes and add them to the header, but I found that the JavaScript provided by the API didn't match what GTM was injecting into the DOM, because GTM minifies/obfuscates the scripts before injecting them.
Now I'm wondering if maybe, just maybe, there's a way to tell GTM to add a nonce to each script it injects, but I can't find any documentation to support this hope/fantasy.
Has anyone run into this, and found a way to fix this?
(I can't just extract the hosts from the scripts as mentioned here - How to make Google Tag Manager and Content-Security-Policy coexist? - because the Custom HTML tags added by our Marketing Team are tags with non-empty bodies, not just tags with a source attribute and no body.)

Enforcing noopener noreferrer with grunt-htmllint

I recently was using create-react-app and noticed that the <a> tag in App.js was using the noopener noreferrer attributes. I also noticed that scattered throughout our code-base, are <a> tags which do not use the above attributes.
I wanted to, using grunt-htmllint, add a rule that would enforce the adding of these attributes but am having trouble with the value that I should add to what I think would be "tag-req-attr".
The documentation for the rule is listed here, but the usage for me is confusing. How can I set the specified <a> tag to include said rules?
I am looking for a way to enforce that the rel attribute contains both noopener and noreferrere.g.:
My Link
Thanks
According to, https://developers.google.com/web/tools/lighthouse/audits/noopener, it looks like noreferrer handles both cases: rel="noreferrer" attribute has the same effect, but also prevents the Referer header from being sent to the new page.
In that case, simply using the link-req-noopener rule should be sufficient.

Adding Facebook Meta tags to dotnetnuke pages

I have added the Facebook comments plugin to dynamic pages on my site, and I am attempting to set up administration of those plugins by adding the associated meta tags to their pages. My site uses the CMS dotnetnuke.
I went to the page's settings - under advanced - and added the appropriate meta tag information. However, upon saving, administration is not enabled on that page.
I ran the page through the wc3 validator, and the following error related to that meta tag was produced:
Error Line 11, Column 1926: there is no attribute "property"
…type="text/javascript"></script><meta property="fb:admins" content="76804243"/>
✉
You have used the attribute named above in your document, but the
document type you are using does not support that attribute for this
element. This error is often caused by incorrect use of the "Strict"
document type with a document that uses frames (e.g. you must use the
"Transitional" document type to get the "target" attribute), or by
using vendor proprietary extensions such as "marginheight" (this is
usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in
the document type you are using, as an undefined element will have no
supported attributes; in this case, see the element-undefined error
message for further information.
How to fix: check the spelling and case of the element and attribute,
(Remember XHTML is all lower-case) and/or check that they are both
allowed in the chosen document type, and/or use CSS instead of this
attribute. If you received this error when using the element
to incorporate flash media in a Web page, see the FAQ item on valid
flash.
Do I need to specify this attribute somehow in my DNN skin? Any ideas on a possible fix?
Thanks!
Alex
There are several ways you can change the DocType for your site. Here's the entry from the DotNetNuke wiki that describes the options:
http://www.dotnetnuke.com/Resources/Wiki/Page/Set-the-doctype-of-your-skin.aspx

Embedding a link (or other html) in a JSF (1.2) message(s)

According to this Question...
Embedding a link (or other html) in a JSF message
... and a relating blog post from BalusC...
http://balusc.blogspot.ch/2010/07/using-html-in-jsf-messages.html
... I only have to remove the import and the annotation of FacesRenderer. There is an equivalent in JSF 1.2 though called Renderer, but this class doesn't cover annotations.
Anyway, I get the following error in my Browser:
Attribute escape invalid for tag messages according to TLD
How can I resolve this issue? Because it seems that adding costum renderer and attribute for a component legal.
A custom attribute requires custom TLD to work properly...

What does "property=''" do?

I'm working on a Drupal site/theme. The CSS and PHP modifications are fairly easy; they just take a little time to learn and get working exactly how I want.
However, I'm having issues applying CSS styles to some elements because of what I think is a property function.
The code looks like <h2 property="dc:title" datatype="" class="node-title">.
What is a property function and what does it do or control within the page? Also how can I modify or remove it?
It's not a property function; it's an attribute that is used from RDFa, and that is added from the RDF module.
The easier way to remove those attributes is to disable the module, but I would not suggest doing it, as the purpose of that module is to enrich your content with metadata to let other applications better understand its relationships and attributes.
Alternatively, if the problem is just with that property, used for the nodes, then you can implement code similar to the following one:
function mymodule_preprocess_node(&$variables) {
if (isset($variables['title_attributes_array'])) {
$variables['title_attributes_array']['property'] = NULL;
}
}
The module should be executed after the RDF module, to allow its hook to be executed after the one implemented by the RDF module.
I have not seen any compatibility problem between the attributes added by the RDF module and the JavaScript code executed by Drupal core or third-party modules. It would probably be the case to investigate why you are having problems with the JavaScript code when those HTML attributes are added.
in your css file, put:
h2[property="dc:title"]{color:#FFFFFF;}
or if it is a link, you may need:
h2[property="dc:title"] a {color:#FFFFFF;}
From wikipedia, check out RDFa
RDFa (or Resource Description
Framework – in – attributes) is a W3C
Recommendation that adds a set of
attribute-level extensions to XHTML
for embedding rich metadata within Web
documents.
It is basically a way to add more metadata to XHTML docs for better semantics.

Resources