On the Firebug Lite website there is information on how to write an extension for Firebug Lite, but it doesn't say how to deploy that extension.
I read that deploying an extension for Firebug is like installing a plugin in Firefox. Is it gonna be the same for an extension of Firebug Lite?
You should be able to extend Firebug Lite by simply including your script on the page as shown on the Firebug Lite website:
Firebug.extend(function(FBL) { with (FBL) {
// ***********************************************************************
function PluginPanel(){};
PluginPanel.prototype = extend(Firebug.Panel,
{
name: "Plugin",
title: "Plugin",
initialize: function(){
Firebug.Panel.initialize.apply(this, arguments);
this.panelNode.innerHTML = "Hello World!";
}
});
Firebug.registerPanel(PluginPanel);
// ***********************************************************************
}});
To include your extension the code needs to be executed after Firebug Lite is loaded. E.g. this can be done by saving the code above into a file and include it via a <script> tag after including Firebug Lite:
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<script type="text/javascript" src="my-firebug-lite-extension.js"></script>
Related
I'm working on a Flutter web project. The web/index.html file is injecting a JavaScript script which could be simplified as:
<script>
window['dataLayer'] = [];
</script>
So in my flutter code, I can do:
#JS()
import 'package:js/js.dart';
#JS('dataLayer.push')
external void push(data);
push(myData);
to push myData in the window.dataLayer array.
However, in the tests, when I'm running
flutter test --platform chrome
I'm getting the error
TypeError: Cannot read properties of undefined (reading 'push')
when I call
push(myData);
because window['dataLayer'] has never been created.
How can I inject some javascript scripts the same way I can do in the index.html?
It is possible to load a custom HTML file while running the tests, see the instructions of the package test.
If your test file name is folder/my_test.dart, then you can create a html file named (folder/my_test.html):
<!doctype html>
<html>
<head>
<title>Custom HTML file title</title>
<link rel="x-dart-test" href="my_test.dart">
<script src="packages/test/dart.js"></script>
<script>
window['dataLayer'] = [];
</script>
</head>
</html>
See this StackOverflow question.
and then you can run
dart test --platform chrome
However, this is only supported with dart test and not flutter test, see this issue. In it, they recommend writing an integration test instead.
I want to use modules in my javascript and html. When i use systemjs with version 5, i am getting error, in github i cant see the steps to configuration. If i removed System.config from below code, at that time i getting CORS issue.
What are the package i have to use to run modules in javascript and html
How to set the configurations for latest version
<!-- <script src="node_modules/traceur/bin/traceur.js"></script>
<script src="node_modules/systemjs/dist//system.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/5.0.0/system.js"></script>
</head>
<body>
<script>
//Configuration
System.config({
'meta': {
'./js/*.js': {
format: 'esm'
}
}
});
System.import('./js/app.js');
</script>
I am getting Error : index.html:18 Uncaught TypeError: System.config is not a function. if I removed system.config i am getting Error : Unable to resolve bare specifier "js/app.js" from file:///C:/Train/ES6/systemjss/ at throwBare (system.js:184) at resolveImportMap (system.js:180) at system.js:734
I'm trying to develop an apache cordova application using Visual studio tools for apache cordova and the facebook connect plugin. With this plugin i'm trying to implement login with facebook.
I installed the plugin from the option custom / plugins, introducing the git repository https://github.com/Wizcorp/phonegap-facebook-plugin
The plugin was successfully installed, the solution compiles correctly.
In the index.html I included the script after platform overrides script:
...
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script type="text/javascript" src="facebookConnectPlugin.js"></script>
<script type="text/javascript" src="scripts/index.js"></script>
</body>
..
The first question is that the facebookConnectPlugin.js was not automatically included within the www root folder in the plugin installation, in this case I don't know how to the application find this script, installing camera.js plugin happened the same but i had not problems in the inclusion, it seem the browser found the js. Where must be located facebookConnectPlugin.js? Do we have to include using the plugins folder? ej:
When I debug the project and tried to launch login with the following instructions it doesn't work:
var fbLoginSuccess = function (userData) {
alert("UserInfo: " + JSON.stringify(userData));
}
function initLogin() {
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
}
The message I found with Ripple -Nexus (galaxy) emulator is:
"I Haz cheeseburger!
FacebookConnectPlugin.login
We seem to be missing some stuff :(
What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute"
Summary:
Which is the src to include the facebookConnectPlugin.js?
Why I found an error with the emulator?
Best regards.
I am trying to add the Facebook plugin (https://github.com/Wizcorp/phonegap-facebook-plugin) to my existing Ionic app, but I cannot get it to work.
I am currently getting the following when I include the plugin script:
Can't find variable: require
Here's the script in my markup:
<script src="cordova.js"></script>
<script src="https://cdn.rawgit.com/Wizcorp/phonegap-facebook-plugin/master/facebookConnectPlugin.js"></script>
If I throw in a reference to requirejs (which I'm using later in the markup for bootstrapping the Angular + RequireJS part of my app), I end up with the following error:
Module name "cordova/exec" has not been loaded yet for context: _. Use require([])
What am I doing wrong?
See the ngCordova facebook plugin document
ngCordova Facebook Plugin
enjoy the program
sample code===
first plugin install and then inject $cordovaFacebook in controller and write some code below
$scope.facebook_login = function() {
$cordovaFacebook.login(["public_profile", "email", "user_friends"])
.then(function(success) {
console.log('Arguments', arguments);
$http.get("https://graph.facebook.com/v2.2/me", {
params: {
access_token: success.authResponse.accessToken,
fields: "id,name,gender,email,birthday",
format: "json"
}
}).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
}, function(error) {
console.log(error);
});
}
as far as i understand you need to install this plugin on your app. I don't see in install guid ability to include it from web. It should build some things and add some settings to cordova. Have you read this instruction?
instruction on git
During the development process, I've been using elm-reactor to test my one-page Elm application. But for production deployment, I would like to just store the compiler's output as static files on a webserver.
How do I compile an Elm page into a standalone pair of HTML + Javascript files?
Use elm-make to compile your Elm application to elm.js (target the module that defines main).
Create your own HTML file that includes that script and a script in the body that executes Elm.<Module-that-defines-main>.fullscreen()
Example
App.elm
module App where
import Text
import Signal
import Graphics.Element (Element)
main : Signal Element
main = "Hello World!" |> Text.asText |> Signal.constant
elm-make App.elm (creates elm.js)
App.html
<!DOCTYPE html>
<html>
<head>
<script src="elm.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">Elm.App.fullscreen()</script>
</body>
</html>
The answer to this ticket on the github project page is also quite helpful:
Finally, use this command to compile the file into a single, stand-alone HTML file.
$ elm make start-test.elm --output index.html