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.
Related
I'm currently working on an IPFS/Ethereum dapp in Muon.
Because i need Metamask i started with this Boilerplate: https://github.com/SwapyNetwork/electron-metamask-boilerplate
Everything is working fine so far.
However i can not use require('anything') in the renderer process or in html script tags. (See below)
There seems to be a problem with the boilerplate code but i can't find it.
Or is node code in renderer not supported in Muon?
My only change in testing is setting node-integration explicitly to true and
inserting require('fs') in index.js. (i installed fs of course).
I tried many different solutions from stackoverflow and other sites but couldn't find a solution yet.
Error Message
Thank you
As per the muon's github repo:
Some of Muons goals include:
Use the Chromium source directly (eliminating electron's copy of chrome_src) with minor patches
make integrating chrome components less painful
faster and more streamlined end-to-end build process (see browser-laptop-bootstrap).
add support for Chrome extensions
add security focused features for the renderer:
remove node completely (from the renderer process)
full sandbox
scriptable window.opener support
As you can see there, muon does not supports node code in the rendered. It is by design for security purpose. Muon may be great for certain applications, but I recommend switching on to electron if you really need to use require in the renderer.
Our NoFlo graph components have suddenly compressed themselves all into one uneditable box that says "WaitForward". See attached image.
For a while, this was happening on every browser, except Opera, so I could go in there and update graphs. Then, a couple of weeks later, even Opera wouldn't render the components, so now I am unable to add anymore logic to existing NoFlo forms.
We barely touch code related to NoFlo, so I don't think anything changed in our environment. My theory is that browsers (such as Chrome, which used to be the one stable browser to use for editing) have been updated recently, and this tool needs some kind of an update in order to render properly. Yet I can find no reference to this issue on the NoFlo GitHub instructions, and it doesn't look like anyone is having that issue here on StackOverflow (until now, of course).
The error message in the console says::
"TypeError: this.node.getTransformToElement is not a function"
I plunked this error into Google and saw that others are experiencing this with something called clientIO, and that recent updates to Google Chrome are to blame, as Chrome has recently removed a core feature that allowed related js to function.
But ... how can I fix this? That is the question!
It looks like recent updates to Google Chrome are the culprit.
Taken straight from jointjs.com's website::
Link to announcement from jointjs.com
Announcement: getTransformToElement() polyfill Nov 12th, 2015
Unfortunately, a new version of Chrome (48) removes a feature that is core to JointJS/Rappid. This feature is the SVGGraphicsElement.getTransformToElement() function. The motivation behind removing the method is - according to the Chrome team - open issues about how this method is supposed to behave.
To overcome compatibility issues with future versions of Chrome, we prepared a polyfill that makes sure this method exists. Before a new version of JointJS/Rappid is released (or if you, for any reason, don't want to upgrade), include the following code before you load your application JavaScript:
SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) {
return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());
};
I was unsure exactly where to put this code in my noflo directory. So I tried putting it at the tippy top of the "app/js/main.js" file. It seems to be working! (But advice for a better location is more than welcome.)
I hope this helps anyone else out there who is experiencing the same issue.
I'm setting up a site using Orchard CMS 1.10 that must support at least IE 7. The jQuery used in Orchard.Modules is the 2.x branch, which doesn't support older versions of IE.
I have tried putting the 1.x version in my theme and defining it like so:
manifest.DefineScript("jQuery").SetUrl("jquery-1.12.2.min.js", "jquery-1.12.2.js");
But everything that requires jQuery still uses the 2.x version from Orchard.Resources. It's not really feasible to to rename it something like "ThemeJQuery" because there are 3rd party modules that require jQuery and I don't want to modify them.
I managed to hack it by setting a version number on the declaration and making it higher than the one in Orchard.Resources, like so:
manifest.DefineScript("jQuery").SetUrl("jquery-1.12.2.min.js", "jquery-1.12.2.js").SetVersion("3.0");
This seems to work, but that fake version number is pretty hacky. Is there a better way to do this?
Are there any existing solutions for run-time bundling of ES6 modules?
I'm looking to simplify JavaScript code development in a MVC5 web app. We're having issues with large, unwieldy JS files, so I'm hoping to get a module loader system in place. So far, I'm not finding any existing bundle transformers for ES6 or another module loader format. I'd be fine with using TypeScript or nodejs require style. I prefer not to use require.js style, though.
Perhaps there's a good reason this solution doesn't exist already. Maybe the dependency resolution processing is too much for a run-time bundling solution. But, I figure it's worth a shot to ask.
Solutions Considered
Prebuilt Web Client
Ultimately, this is where I want to be, but I need a stop-gap solution for now. I know how to put together a build system for an HTML client using grunt/gulp/webpack. But I don't want to have to tell developers to run webpack -w or something similar during development. Nor do I want to tell them to rebuild a solution for every JS change. They should be able to modify the file, refresh the browser, and see the change.
Directory Structure
This is the route I'll probably end up going with. Basically, this JS codebase consists of jQuery widgets and plain JS (helpers/common functions). So, if I structure the code in this directory structure and include the js dir, it should get me most of the way there:
js (DIR)
app-start.js
helpers (DIR)
widgets (DIR)
Widgets should be fine. Helpers, I can see issues where one function/class depends on another. Though, since a function call should never start with a helper (only a widget), this should work fine, assuming no globals are used (or maybe one global like 'App').
I have a problem regarding the security of QtWebKit, I wanna disable X-Frame-Options so I can embed sites such as facebook.com in iframes inside my app.
I know that can be made using WebCore API (isWebSecurityEnabled switch, http://trac.webkit.org/wiki/ConfigurableFeatures) but I didn't found any way of doing it with QtWebKit.
Thank you!
I had the same problem (but applied to command-line-browser phantonjs with the rendering engine QtWebKit) and the only option after analyzing the issue, is modifying the behavior of rendering of QtWebKit.
The good, the change is very small, we just change the function FrameLoader :: shouldInterruptLoadForXFrameOptions to return false in any condition (https://github.com/deerme/phantomjs/blob/master/src/qt/qtwebkit/Source/WebCore/loader/FrameLoader.cpp#L2986).
In my particular case I did a fork of the phantonjs repository with this small change in QtWebKit (https://github.com/deerme/phantomjs).
So, in your particular case, you should download the source code of QtWebEngine and make the change and finally you can use the QtWebEngine modified in your Qt application.