import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1234012 - Do not try to copy files from the non-existing default profile. r=bsmedberg (d30314c902)
- Bug 1192831 - Remove PlayPreview API. r=jet, r=peterv (bb33dc609d)
- Bug 1098064 part B - remove nsIPluginHost.isPluginOOP, r=jimm (39643555da)
- Bug 1239913 - Convert toolkit/ to use asyncOpen2 where loadingPrincipal is SystemPrincipal (r=sicking) (b7d663d0e6)
- minor (ac122dbb68)
- Bug 1216972 - OS.File AsyncShutdown for content processes. r=froydnj (53550f1050)
- Bug 1204834 - OS.File.writeAtomic should have the path argument in its closure. r=yoric (8dcf508961)
- Bug 1201904 - Add test for force windowless mode. r=aklotz (ae4e591342)
- Bug 1131368 - test plugin.allowed_types pref; r=josh (6a61ae8592)
- Bug 1129040 - Query the chrome process blocklist service prior to instantiating plugins in the content process. r=billm (398664884f)
- Bug 1225293 - Add Microsoft Silverlight to Win64 Plugin Whitelist; r=bsmedberg (eeecf59efc)
- Bug 1165981 - Mochitests and test plugin for Win64 plugin disabling; r=bsmedberg (82211ff568)
- Bug 1213710 part 1 - Convert all html/xul files in dom/plugins/test/mochitest to unix format. r=bsmedberg (8f89d2ac1d)
- Bug 1213710 part 2 - Rename dom/plugins/test/mochitest/utils.js to plugin-utils.js. r=bsmedberg (e74d035ffc)
- Bug 1225293 - Mochitests for Win64 Silverlight Whitelisting; r=bsmedberg (079ed3a442)
- minor bits left out (5fa7b83b68)
- Bug 1214516 - Sync check PBackgroundChild existence to initiate indexed DB open/delete request right away if it exists. r=khuey (8a2c5c7f8f)
- Bug 1200004 - Fix IDB permission handling around navigated windows. r=baku (cea1d31ed9)
- Bug 1239751 - FieldInfoHash does not need a post barrier; r=jonco (70b443bc23)
- Bug 891107 - Part 5: Show function name in this and callee type error messages in js-ctypes. r=jorendorff (4358085f8f)
- Bug 891107 - Part 6: Show information about range and value in array index error messages in js-ctypes. r=jorendorff (dfa926dc95)
- Bug 891107 - Part 7: Show information about value, type, function, and argument number in function related error messages in js-ctypes. r=jorendorff (4b71ee5304)
- Bug 891107 - Part 8: Show information about field name and type in struct field related error messages in js-ctypes. r=jorendorff (3a128382a6)
- Bug 891107 - Part 9: Report construction error as TypeError in js-ctypes. r=jorendorff (4199e59c7b)
- Bug 891107 - Part 10: Show information about value in pointer related error messages in js-ctypes. r=jorendorff (ad7e5fe53d)
- Bug 891107 - Part 11: Show information about type in cast error messages in js-ctypes. r=jorendorff (74fe412bb9)
- Bug 1243918 - Don't clobber safeseh in msvcc.sh -clang-cl; r=glandium (f014a945c9)
- default to -O3 again (0d9261962c)
- Bug 1239369 - Restore oomTests's check that an exception is thrown on failure, except where it isn't r=terrence (9f00c22106)
- Bug 1203595 - move tests into manual-tests. r=waldo (444b7c10aa)
- Bug 1079844 - Rename the shell builtin 'neuter' function to 'detachArrayBuffer', consistent with the spec name for the operation. r=till (48cfe8ff3a)
- Bug 1234428 - findPath wrap cross-compartment objects. r=jonco (2ca70c86b0)
- minor (c32fe44e31)
- Add a semicolon to avoid relying on ASI in one place in String.js. No bug, r=trivial (5f005bf2af)
- minor (2604e4d608)
- Bug 1132630 - Prefix bound function names. r=till (3b30a82402)
- Bug 1246157 - avoid memory leak when bindings->init fails. r=jcoppeard (e1f4513225)
- Bug 1241116: Fix a leak in js_StartPref; r=nbp (8d258dcb05)
- Bug 1232015 - Update pdf.js to version 1.3.72. r=bdahl (20cb998eff)
- Bug 1232196 - Update pdf.js to version 1.3.76. r=bdahl (a324208154)
- Bug 1233801 - Update pdf.js to version 1.3.110. r=bdahl (071620492b)
- Bug 1235724 - Update pdf.js to version 1.3.142. r=bdahl (0f1f4703e4)
- Bug 1167224 - Remove getMostRecentBrowserWindow() from nsIBrowserGlue and use RecentWindow in nsBrowserGlue.js. r=mak (bcfa5b5eac)
- remove duplicate (9978d0a5d8)
- Bug 1194903 - Increase the timeout of browser_pdfjs_zoom.js (1103f801ae)
- Bug 1170339 - Increase the timeout of browser_pdfjs_navigation.js (e4c9517f36)
- Bug 1237815 - Update pdf.js to version 1.3.161. r=bdahl (6c4c566eab)
- Bug 1198459 - Add some AppConstant use. r=felipe (69400b0cef)
- Bug 1191242 - Instrument the default browser prompt. r=dolske p=bsmedberg (85f43f1b7d)
- Bug 1198459 - Modify existing a11y prompting to support disabling a11y in content until a restart. r=felipe (aaeac171b1)
- bit of Bug 1241993 (25de6f8509)
- Bug 1221050 - part 1: set up migration infrastructure, r=ttaubert (22347f42a2)
- Bug 1225648 - Remove duplicate skipDefaultBrowser code and fix double-counting error when tracking prompt counts. r=Gijs (da4603369b)
- Bug 1193204 - Remove browser.devedition.theme.enabled check when unapplying theme in ui migration;r=Gijs (148d6d599d)
- Bug 1205038 - Add missing BROWSER_SET_DEFAULT_ALWAYS_CHECK probe to Histograms.json, and fix BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS by fixing callback. r=dolske,Gijs (880b22e029)
- Bug 1238679 - Mark the Bool32x4 functions as inlinable. r=bbouvier (f0ea70894e)
- Bug 992472 - Remove self-hosting macros ARRAY_PUSH and ARRAY_SLICE. r=efaust (60ae1d29a9)
- missing bit of 1040390 (dea7f70cf1)
- Bug 1246136: Check for dead code in assertion in EmitIfElse; r=luke (03d6f690da)
- Bug 1241233 - Odin: don't report symbolicLinks memory usage twice (r=bbouvier) (f2344bc392)
- Bug 1241581 - Put back null filename checks (r=bbouvier) (3c54ac7cf9)
- Bug 1249787 - BaldrMonkey: Fix wasm string hex escape parsing endianness. r=luke (bf3aeb7ddb)
- Bug 1229855: Fix miscompilation of uint8_t enum class with gcc4.8.2; r=luke (a86039958b)
- Bug 1241454: Fix enum class storage of ExprType; r=bustage (9ee3368aed)
- Bug 1248502 - Remove obsolete variants and configure flags, r=terrence (5dbcd14884)
This commit is contained in:
2023-12-12 14:29:52 +08:00
parent ecf6c2a1b9
commit 7abb13fe93
257 changed files with 37867 additions and 35016 deletions
+3
View File
@@ -661,6 +661,9 @@ pref("accessibility.typeaheadfind.timeout", 5000);
pref("accessibility.typeaheadfind.linksonly", false);
pref("accessibility.typeaheadfind.flashBar", 1);
// Tracks when accessibility is loaded into the previous session.
pref("accessibility.loadedInLastSession", false);
// by default we show an infobar message when pages require plugins that are blocked, or are outdated
pref("plugins.hide_infobar_for_blocked_plugin", false);
pref("plugins.hide_infobar_for_outdated_plugin", false);
@@ -33,7 +33,6 @@ support-files =
plugin_test.html
plugin_test2.html
plugin_test3.html
plugin_test_w_src.html
plugin_two_types.html
plugin_unknown.html
plugin_crashCommentAndURL.html
@@ -72,9 +71,4 @@ skip-if = e10s # bug 1160166
[browser_plugin_reloading.js]
[browser_blocklist_content.js]
[browser_pageInfo_plugins.js]
[browser_pluginplaypreview.js]
skip-if = e10s # bug 1148827
[browser_pluginplaypreview2.js]
skip-if = e10s # bug 1148827
[browser_pluginplaypreview3.js]
[browser_private_clicktoplay.js]
+179 -132
View File
@@ -64,6 +64,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TabGroupsMigrator",
"resource:///modules/TabGroupsMigrator.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
@@ -369,7 +372,7 @@ BrowserGlue.prototype = {
case "handle-xul-text-link":
let linkHandled = subject.QueryInterface(Ci.nsISupportsPRBool);
if (!linkHandled.data) {
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
if (win) {
win.openUILinkIn(data, "tab");
linkHandled.data = true;
@@ -780,7 +783,7 @@ BrowserGlue.prototype = {
},
_showSlowStartupNotification: function () {
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win)
return;
@@ -814,7 +817,7 @@ BrowserGlue.prototype = {
* Show a notification bar offering a reset if the profile has been unused for some time.
*/
_resetUnusedProfileNotification: function () {
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win)
return;
@@ -844,7 +847,7 @@ BrowserGlue.prototype = {
},
_notifyUnsignedAddonsDisabled: function () {
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win)
return;
@@ -1000,7 +1003,7 @@ BrowserGlue.prototype = {
// them to the user.
let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED);
if (changedIDs.length > 0) {
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
AddonManager.getAddonsByIDs(changedIDs, function(aAddons) {
aAddons.forEach(function(aAddon) {
// If the add-on isn't user disabled or can't be enabled then skip it.
@@ -1056,11 +1059,59 @@ BrowserGlue.prototype = {
catch (ex) { /* never mind; suppose SessionStore is broken */ }
// startup check, check all assoc
let isDefault = ShellService.isDefaultBrowser(true, false);
let isDefault = false;
let isDefaultError = false;
try {
isDefault = ShellService.isDefaultBrowser(true, false);
} catch (ex) {
isDefaultError = true;
}
if (shouldCheck && !isDefault && !willRecoverSession) {
if (isDefault) {
let now = (Math.floor(Date.now() / 1000)).toString();
Services.prefs.setCharPref("browser.shell.mostRecentDateSetAsDefault", now);
}
let willPrompt = shouldCheck && !isDefault && !willRecoverSession;
// Skip the "Set Default Browser" check during first-run or after the
// browser has been run a few times.
if (willPrompt) {
if (skipDefaultBrowserCheck) {
Services.prefs.setBoolPref("browser.shell.skipDefaultBrowserCheck", false);
willPrompt = false;
} else {
promptCount++;
}
if (promptCount > 3) {
willPrompt = false;
}
}
if (!AppConstants.RELEASE_BUILD) {
if (willPrompt) {
Services.prefs.setIntPref("browser.shell.defaultBrowserCheckCount",
promptCount);
}
}
try {
// Report default browser status on startup to telemetry
// so we can track whether we are the default.
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
.add(isDefault);
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
.add(isDefaultError);
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ALWAYS_CHECK")
.add(shouldCheck);
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT")
.add(promptCount);
}
catch (ex) { /* Don't break the default prompt if telemetry is broken. */ }
if (willPrompt) {
Services.tm.mainThread.dispatch(function() {
DefaultBrowserCheck.prompt(this.getMostRecentBrowserWindow());
DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow());
}.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
}
}
@@ -1068,6 +1119,19 @@ BrowserGlue.prototype = {
if (AppConstants.E10S_TESTING_ONLY) {
E10SUINotification.checkStatus();
}
if (AppConstants.platform == "win") {
// Handles prompting to inform about incompatibilites when accessibility
// and e10s are active together.
E10SAccessibilityCheck.init();
}
},
_maybeMigrateTabGroups() {
let migrationObserver = (stateAsSupportsString, topic) => {
Services.obs.removeObserver(migrationObserver, "sessionstore-state-read");
TabGroupsMigrator.migrate(stateAsSupportsString);
};
Services.obs.addObserver(migrationObserver, "sessionstore-state-read", false);
},
_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
@@ -1251,7 +1315,7 @@ BrowserGlue.prototype = {
let key = getNotifyString({propName: "notificationButtonAccessKey",
stringName: "pu.notifyButton.accesskey"});
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
let notifyBox = win.gBrowser.getNotificationBox();
let buttons = [
@@ -1283,12 +1347,11 @@ BrowserGlue.prototype = {
let url = getNotifyString({propName: "alertURL",
prefName: "startup.homepage_override_url"});
var self = this;
function clickCallback(subject, topic, data) {
// This callback will be called twice but only once with this topic
if (topic != "alertclickcallback")
return;
let win = self.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
win.openUILinkIn(data, "tab");
}
@@ -1314,7 +1377,7 @@ BrowserGlue.prototype = {
// getService(Ci.nsIURLFormatter);
// var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
//
// var win = this.getMostRecentBrowserWindow();
// var win = RecentWindow.getMostRecentBrowserWindow();
// win.openUILinkIn(updateUrl, "tab");
},
@@ -1513,7 +1576,7 @@ BrowserGlue.prototype = {
.getHistogramById("PLACES_BACKUPS_DAYSFROMLAST")
.add(backupAge);
} catch (ex) {
Components.utils.reportError("Unable to report telemetry.");
Cu.reportError("Unable to report telemetry.");
}
if (backupAge > BOOKMARKS_BACKUP_MAX_INTERVAL_DAYS)
@@ -1550,7 +1613,7 @@ BrowserGlue.prototype = {
* If a backup for today doesn't exist, this creates one.
*/
_backupBookmarks: function BG__backupBookmarks() {
return Task.spawn(function() {
return Task.spawn(function*() {
let lastBackupFile = yield PlacesBackups.getMostRecentBackup();
// Should backup bookmarks if there are no backups or the maximum
// interval between backups elapsed.
@@ -1579,7 +1642,7 @@ BrowserGlue.prototype = {
formatURLPref("app.support.baseURL");
url += helpTopic;
var win = this.getMostRecentBrowserWindow();
var win = RecentWindow.getMostRecentBrowserWindow();
var buttons = [
{
@@ -1600,7 +1663,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 32;
const UI_VERSION = 35;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
let currentUIVersion = 0;
try {
@@ -1925,16 +1988,10 @@ BrowserGlue.prototype = {
defaultThemeSelected = Services.prefs.getCharPref("general.skins.selectedSkin") == "classic/1.0";
} catch(e) {}
let deveditionThemeEnabled = false;
try {
deveditionThemeEnabled = Services.prefs.getBoolPref("browser.devedition.theme.enabled");
} catch(e) {}
// If we are on the devedition channel, the devedition theme is on by
// default. But we need to handle the case where they didn't want it
// applied, and unapply the theme.
let userChoseToNotUseDeveditionTheme =
!deveditionThemeEnabled ||
!defaultThemeSelected ||
(lightweightThemeSelected && selectedThemeID != "firefox-devedition@mozilla.org");
@@ -1942,8 +1999,6 @@ BrowserGlue.prototype = {
Services.prefs.setCharPref("lightweightThemes.selectedThemeID", "");
}
// Not clearing browser.devedition.theme.enabled, to preserve user's pref
// if for some reason this function runs again (even though it shouldn't)
Services.prefs.clearUserPref("browser.devedition.showCustomizeButton");
}
@@ -1956,6 +2011,10 @@ BrowserGlue.prototype = {
this._notifyNotificationsUpgrade().catch(Cu.reportError);
}
if (currentUIVersion < 35) {
this._maybeMigrateTabGroups();
}
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
@@ -2142,11 +2201,6 @@ BrowserGlue.prototype = {
}
}),
// this returns the most recent non-popup browser window
getMostRecentBrowserWindow: function BG_getMostRecentBrowserWindow() {
return RecentWindow.getMostRecentBrowserWindow();
},
/**
* Open preferences even if there are no open windows.
*/
@@ -2204,50 +2258,7 @@ BrowserGlue.prototype = {
Services.prefs.setBoolPref("dom.ipc.plugins.flash.disable-protected-mode", true);
Services.prefs.setBoolPref("browser.flash-protected-mode-flip.done", true);
let win = this.getMostRecentBrowserWindow();
if (!win) {
return;
}
let productName = Services.strings
.createBundle("chrome://branding/locale/brand.properties")
.GetStringFromName("brandShortName");
let message = win.gNavigatorBundle.
getFormattedString("flashHang.message", [productName]);
let buttons = [{
label: win.gNavigatorBundle.getString("flashHang.helpButton.label"),
accessKey: win.gNavigatorBundle.getString("flashHang.helpButton.accesskey"),
callback: function() {
win.openUILinkIn("https://support.mozilla.org/kb/flash-protected-mode-autodisabled", "tab");
}
}];
let nb = win.document.getElementById("global-notificationbox");
nb.appendNotification(message, "flash-hang", null,
nb.PRIORITY_INFO_MEDIUM, buttons);
},
_handleFlashHang: function() {
++this._flashHangCount;
if (this._flashHangCount < 2) {
return;
}
// protected mode only applies to win32
if (Services.appinfo.XPCOMABI != "x86-msvc") {
return;
}
if (Services.prefs.getBoolPref("dom.ipc.plugins.flash.disable-protected-mode")) {
return;
}
if (!Services.prefs.getBoolPref("browser.flash-protected-mode-flip.enable")) {
return;
}
if (Services.prefs.getBoolPref("browser.flash-protected-mode-flip.done")) {
return;
}
Services.prefs.setBoolPref("dom.ipc.plugins.flash.disable-protected-mode", true);
Services.prefs.setBoolPref("browser.flash-protected-mode-flip.done", true);
let win = this.getMostRecentBrowserWindow();
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) {
return;
}
@@ -2633,6 +2644,8 @@ ContentPermissionPrompt.prototype = {
var DefaultBrowserCheck = {
get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
_setAsDefaultTimer: null,
_setAsDefaultButtonClickStartTime: 0,
closePrompt: function(aNode) {
if (this._notification) {
@@ -2655,9 +2668,45 @@ var DefaultBrowserCheck = {
}
try {
ShellService.setDefaultBrowser(claimAllTypes, false);
if (this._setAsDefaultTimer) {
this._setAsDefaultTimer.cancel();
}
this._setAsDefaultButtonClickStartTime = Math.floor(Date.now() / 1000);
this._setAsDefaultTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this._setAsDefaultTimer.init(() => {
let isDefault = false;
let isDefaultError = false;
try {
isDefault = ShellService.isDefaultBrowser(true, false);
} catch (ex) {
isDefaultError = true;
}
let now = Math.floor(Date.now() / 1000);
let runTime = now - this._setAsDefaultButtonClickStartTime;
if (isDefault || runTime > 600) {
this._setAsDefaultTimer.cancel();
this._setAsDefaultTimer = null;
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
.add(runTime);
}
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
.add(isDefaultError);
}, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
} catch (ex) {
setAsDefaultError = true;
Cu.reportError(ex);
}
// Here BROWSER_IS_USER_DEFAULT and BROWSER_SET_USER_DEFAULT_ERROR appear
// to be inverse of each other, but that is only because this function is
// called when the browser is set as the default. During startup we record
// the BROWSER_IS_USER_DEFAULT value without recording BROWSER_SET_USER_DEFAULT_ERROR.
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
.add(!setAsDefaultError);
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ERROR")
.add(setAsDefaultError);
},
_createPopup: function(win, notNowStrings, neverStrings) {
@@ -2769,6 +2818,12 @@ var DefaultBrowserCheck = {
} else if (!shouldAsk.value) {
ShellService.shouldCheckDefaultBrowser = false;
}
try {
let resultEnum = rv * 2 + shouldAsk.value;
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_RESULT")
.add(resultEnum);
} catch (ex) { /* Don't break if Telemetry is acting up. */ }
}
},
@@ -2792,16 +2847,9 @@ var E10SUINotification = {
PREVIOUS_PROMPT_PREF: "browser.displayedE10SPrompt",
checkStatus: function() {
let skipE10sChecks = false;
try {
let updateChannel = UpdateUtils.UpdateChannel;
let channelAuthorized = updateChannel == "nightly" || updateChannel == "aurora";
skipE10sChecks = !channelAuthorized ||
Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y");
} catch(e) {}
if (skipE10sChecks) {
let updateChannel = UpdateUtils.UpdateChannel;
let channelAuthorized = updateChannel == "nightly" || updateChannel == "aurora";
if (!channelAuthorized) {
return;
}
@@ -2816,12 +2864,6 @@ var E10SUINotification = {
this._showE10sActivatedNotice();
}
// e10s doesn't work with accessibility, so we prompt to disable
// e10s if a11y is enabled, now or in the future.
Services.obs.addObserver(this, "a11y-init-or-shutdown", true);
if (Services.appinfo.accessibilityIsBlacklistedForE10S) {
this._showE10sAccessibilityWarning();
}
} else {
let e10sPromptShownCount = 0;
try {
@@ -2854,14 +2896,6 @@ var E10SUINotification = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
observe: function(subject, topic, data) {
if (topic == "a11y-init-or-shutdown"
&& data == "1" &&
Services.appinfo.accessibilityIsBlacklistedForE10S) {
this._showE10sAccessibilityWarning();
}
},
_showE10sActivatedNotice: function() {
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win)
@@ -2939,62 +2973,75 @@ var E10SUINotification = {
_warnedAboutAccessibility: false,
_showE10sAccessibilityWarning: function() {
try {
if (!Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y")) {
// Only return if the pref exists and was set to false, but not
// if the pref didn't exist (which will throw).
return;
}
} catch (e) { }
// We don't prompt about a11y incompat if e10s is off.
if (!Services.appinfo.browserTabsRemoteAutostart) {
return;
}
Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", true);
// If the user set the forced pref and it's true, ignore a11y init.
// If the pref doesn't exist or if it's false, prompt.
if (this.forcedOn) {
return;
}
// Only prompt once per session
if (this._warnedAboutAccessibility) {
return;
}
this._warnedAboutAccessibility = true;
let win = RecentWindow.getMostRecentBrowserWindow();
let browser = win.gBrowser.selectedBrowser;
if (!win) {
// Just restart immediately.
Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
Services.console.logStringMessage("Accessibility support is partially disabled due to compatibility issues with new features.");
return;
}
let browser = win.gBrowser.selectedBrowser;
// We disable a11y for content and prompt on the chrome side letting
// a11y users know they need to disable e10s and restart.
let promptMessage = win.gNavigatorBundle.getFormattedString(
"e10s.accessibilityNotice.mainMessage",
"e10s.accessibilityNotice.mainMessage2",
[gBrandBundle.GetStringFromName("brandShortName")]
);
let mainAction = {
label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.disableAndRestart.label"),
accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.disableAndRestart.accesskey"),
callback: function () {
// Restart the app
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
if (cancelQuit.data)
return; // somebody canceled our quit request
Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
let notification;
let restartCallback = function() {
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
if (cancelQuit.data) {
return; // somebody canceled our quit request
}
// Restart the browser
Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
};
let secondaryActions = [
{
label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.label"),
accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.accesskey"),
callback: function () {
Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", false);
}
}
];
// main option: an Ok button, keeps running with content accessibility disabled
let mainAction = {
label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.acceptButton.label"),
accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.acceptButton.accesskey"),
callback: function () {
// If the user invoked the button option remove the notification,
// otherwise keep the alert icon around in the address bar.
notification.remove();
},
dismiss: true
};
// secondary option: a restart now button. When we restart e10s will be disabled due to
// accessibility having been loaded in the previous session.
let secondaryActions = [{
label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.enableAndRestart.label"),
accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.enableAndRestart.accesskey"),
callback: restartCallback,
}];
let options = {
popupIconURL: "chrome://browser/skin/e10s-64@2x.png",
learnMoreURL: "https://wiki.mozilla.org/Electrolysis",
persistWhileVisible: true
learnMoreURL: Services.urlFormatter.formatURLPref("app.support.e10sAccessibilityUrl"),
persistWhileVisible: true,
hideNotNow: true,
};
win.PopupNotifications.show(browser, "a11y_enabled_with_e10s", promptMessage, null, mainAction, secondaryActions, options);
notification =
win.PopupNotifications.show(browser, "a11y_enabled_with_e10s",
promptMessage, null, mainAction,
secondaryActions, options);
},
};
+1 -6
View File
@@ -23,7 +23,7 @@ interface nsIDOMWindow;
*
*/
[scriptable, uuid(ea083cb7-6b9d-4695-8b34-2e8f6ce2a860)]
[scriptable, uuid(b0e7c156-d00c-4605-a77d-27c7418f23ae)]
interface nsIBrowserGlue : nsISupports
{
/**
@@ -34,9 +34,4 @@ interface nsIBrowserGlue : nsISupports
*
*/
void sanitize(in nsIDOMWindow aParentWindow);
/**
* Gets the most recent window that's a browser (but not a popup)
*/
nsIDOMWindow getMostRecentBrowserWindow();
};
@@ -325,47 +325,6 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
return NS_OK;
}
NS_IMETHODIMP
nsGNOMEShellService::GetShouldSkipCheckDefaultBrowser(bool* aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
}
rv = prefs->GetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, aResult);
if (NS_FAILED(rv)) {
return rv;
}
if (*aResult) {
// Only skip the default browser check once. The next attempt in
// a new session should proceed.
return prefs->SetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, false);
}
int32_t defaultBrowserCheckCount;
rv = prefs->GetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
&defaultBrowserCheckCount);
if (NS_FAILED(rv)) {
return rv;
}
if (defaultBrowserCheckCount < 3) {
*aResult = false;
return prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
defaultBrowserCheckCount + 1);
}
// Disable the default browser check after three attempts.
// Don't modify PREF_CHECKDEFAULTBROWSER since that is a
// user-initiated action and it shouldn't get re-enabled
// if it has been user disabled.
*aResult = true;
return rv;
}
NS_IMETHODIMP
nsGNOMEShellService::GetShouldCheckDefaultBrowser(bool* aResult)
{
@@ -377,18 +336,6 @@ nsGNOMEShellService::GetShouldCheckDefaultBrowser(bool* aResult)
}
nsresult rv;
#ifndef RELEASE_BUILD
bool skipDefaultBrowserCheck;
rv = GetShouldSkipCheckDefaultBrowser(&skipDefaultBrowserCheck);
if (NS_FAILED(rv)) {
return rv;
}
if (skipDefaultBrowserCheck) {
*aResult = false;
return rv;
}
#endif
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
@@ -5,7 +5,7 @@
#include "nsIShellService.idl"
[scriptable, uuid(7f8ca08e-1df4-4735-86e9-50dedb48e5e8)]
[scriptable, uuid(291a27cd-ef4c-46c6-a2f8-83182498167e)]
interface nsIMacShellService : nsIShellService
{
const long APPLICATION_KEYCHAIN_ACCESS = 2;
+1 -8
View File
@@ -8,7 +8,7 @@
interface nsIDOMElement;
interface nsIFile;
[scriptable, uuid(55cb78a8-2fc4-48f4-9345-ff0e541c5cc4)]
[scriptable, uuid(53f4bc4a-5b86-4643-8e67-4907ecbab34c)]
interface nsIShellService : nsISupports
{
/**
@@ -46,13 +46,6 @@ interface nsIShellService : nsISupports
*/
attribute boolean shouldCheckDefaultBrowser;
/**
* Used to determine whether or not the "Set Default Browser" check
* should be skipped during first-run or after the browser has been
* run a few times.
*/
readonly attribute boolean shouldSkipCheckDefaultBrowser;
/**
* Used to determine whether or not to offer "Set as desktop background"
* functionality. Even if shell service is available it is not
@@ -5,7 +5,7 @@
#include "nsIShellService.idl"
[scriptable, uuid(89b0a761-d9a0-4c39-ab83-d81566459a31)]
[scriptable, uuid(13f20725-4fd5-431f-90a1-525ab31755b1)]
interface nsIWindowsShellService : nsIShellService
{
/**
@@ -103,47 +103,6 @@ nsMacShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
return NS_OK;
}
NS_IMETHODIMP
nsMacShellService::GetShouldSkipCheckDefaultBrowser(bool* aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
}
rv = prefs->GetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, aResult);
if (NS_FAILED(rv)) {
return rv;
}
if (*aResult) {
// Only skip the default browser check once. The next attempt in
// a new session should proceed.
return prefs->SetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, false);
}
int32_t defaultBrowserCheckCount;
rv = prefs->GetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
&defaultBrowserCheckCount);
if (NS_FAILED(rv)) {
return rv;
}
if (defaultBrowserCheckCount < 3) {
*aResult = false;
return prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
defaultBrowserCheckCount + 1);
}
// Disable the default browser check after three attempts.
// Don't modify PREF_CHECKDEFAULTBROWSER since that is a
// user-initiated action and it shouldn't get re-enabled
// if it has been user disabled.
*aResult = true;
return rv;
}
NS_IMETHODIMP
nsMacShellService::GetShouldCheckDefaultBrowser(bool* aResult)
{
@@ -155,18 +114,6 @@ nsMacShellService::GetShouldCheckDefaultBrowser(bool* aResult)
}
nsresult rv;
#ifndef RELEASE_BUILD
bool skipDefaultBrowserCheck;
rv = GetShouldSkipCheckDefaultBrowser(&skipDefaultBrowserCheck);
if (NS_FAILED(rv)) {
return rv;
}
if (skipDefaultBrowserCheck) {
*aResult = false;
return rv;
}
#endif
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
@@ -746,47 +746,6 @@ nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
return rv;
}
NS_IMETHODIMP
nsWindowsShellService::GetShouldSkipCheckDefaultBrowser(bool* aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
}
rv = prefs->GetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, aResult);
if (NS_FAILED(rv)) {
return rv;
}
if (*aResult) {
// Only skip the default browser check once. The next attempt in
// a new session should proceed.
return prefs->SetBoolPref(PREF_SKIPDEFAULTBROWSERCHECK, false);
}
int32_t defaultBrowserCheckCount;
rv = prefs->GetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
&defaultBrowserCheckCount);
if (NS_FAILED(rv)) {
return rv;
}
if (defaultBrowserCheckCount < 3) {
*aResult = false;
return prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT,
defaultBrowserCheckCount + 1);
}
// Disable the default browser check after three attempts.
// Don't modify PREF_CHECKDEFAULTBROWSER since that is a
// user-initiated action and it shouldn't get re-enabled
// if it has been user disabled.
*aResult = true;
return rv;
}
NS_IMETHODIMP
nsWindowsShellService::GetShouldCheckDefaultBrowser(bool* aResult)
{
@@ -800,18 +759,6 @@ nsWindowsShellService::GetShouldCheckDefaultBrowser(bool* aResult)
}
nsresult rv;
#ifndef RELEASE_BUILD
bool skipDefaultBrowserCheck;
rv = GetShouldSkipCheckDefaultBrowser(&skipDefaultBrowserCheck);
if (NS_FAILED(rv)) {
return rv;
}
if (skipDefaultBrowserCheck) {
*aResult = false;
return rv;
}
#endif
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
return rv;
+1 -1
View File
@@ -1,3 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.3.56
Current extension version is: 1.3.161
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -264,3 +264,4 @@ var NetworkManager = (function NetworkManagerClosure() {
return NetworkManager;
})();
+48 -35
View File
@@ -77,44 +77,11 @@
}
.annotationLayer .annotLink > a:hover {
opacity: 0.2;
background: #ff0;
box-shadow: 0px 2px 10px #ff0;
}
.annotationLayer .annotText > img {
.annotationLayer section {
position: absolute;
cursor: pointer;
}
.annotationLayer .annotTextContentWrapper {
position: absolute;
width: 20em;
}
.annotationLayer .annotTextContent {
z-index: 200;
float: left;
max-width: 20em;
background-color: #FFFF99;
box-shadow: 0px 2px 5px #333;
border-radius: 2px;
padding: 0.6em;
cursor: pointer;
}
.annotationLayer .annotTextContent > h1 {
font-size: 1em;
border-bottom: 1px solid #000000;
padding-bottom: 0.2em;
}
.annotationLayer .annotTextContent > p {
padding-top: 0.2em;
}
.annotationLayer .annotLink > a {
.annotationLayer .linkAnnotation > a {
position: absolute;
font-size: 1em;
top: 0;
@@ -123,6 +90,52 @@
height: 100%;
}
.annotationLayer .linkAnnotation > a:hover {
opacity: 0.2;
background: #ff0;
box-shadow: 0px 2px 10px #ff0;
}
.annotationLayer .textAnnotation img {
position: absolute;
cursor: pointer;
}
.annotationLayer .popupWrapper {
position: absolute;
width: 20em;
}
.annotationLayer .popup {
position: absolute;
z-index: 200;
max-width: 20em;
background-color: #FFFF99;
box-shadow: 0px 2px 5px #333;
border-radius: 2px;
padding: 0.6em;
margin-left: 5px;
cursor: pointer;
word-wrap: break-word;
}
.annotationLayer .popup h1 {
font-size: 1em;
border-bottom: 1px solid #000000;
padding-bottom: 0.2em;
}
.annotationLayer .popup p {
padding-top: 0.2em;
}
.annotationLayer .highlightAnnotation,
.annotationLayer .underlineAnnotation,
.annotationLayer .squigglyAnnotation,
.annotationLayer .strikeoutAnnotation {
cursor: pointer;
}
.pdfViewer .canvasWrapper {
overflow: hidden;
}
+65 -132
View File
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PDFJS, PDFBug, FirefoxCom, Stats, Cache, ProgressBar,
/* globals PDFJS, PDFBug, FirefoxCom, Stats, ProgressBar,
DownloadManager, getFileName, getPDFFileNameFromURL,
PDFHistory, Preferences, SidebarView, ViewHistory, Stats,
PDFThumbnailViewer, URL, noContextMenuHandler, SecondaryToolbar,
@@ -34,10 +34,12 @@ var SCALE_SELECT_PADDING = 22;
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
PDFJS.imageResourcesPath = './images/';
function configure(PDFJS) {
PDFJS.imageResourcesPath = './images/';
PDFJS.workerSrc = '../build/pdf.worker.js';
PDFJS.cMapUrl = '../web/cmaps/';
PDFJS.cMapPacked = true;
}
var mozL10n = document.mozL10n || document.webL10n;
@@ -50,12 +52,6 @@ var MAX_AUTO_SCALE = 1.25;
var SCROLLBAR_PADDING = 40;
var VERTICAL_PADDING = 5;
var NullCharactersRegExp = /\x00/g;
function removeNullCharacters(str) {
return str.replace(NullCharactersRegExp, '');
}
function getFileName(url) {
var anchor = url.indexOf('#');
var query = url.indexOf('?');
@@ -1530,7 +1526,7 @@ var PDFLinkService = (function () {
return pdfOpenParams;
}
}
return '';
return this.getAnchorUrl('');
},
/**
@@ -3439,7 +3435,7 @@ var TEXT_LAYER_RENDER_DELAY = 200; // ms
* @property {PageViewport} defaultViewport - The page viewport.
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
* @property {IPDFTextLayerFactory} textLayerFactory
* @property {IPDFAnnotationsLayerFactory} annotationsLayerFactory
* @property {IPDFAnnotationLayerFactory} annotationLayerFactory
*/
/**
@@ -3447,8 +3443,6 @@ var TEXT_LAYER_RENDER_DELAY = 200; // ms
* @implements {IRenderableView}
*/
var PDFPageView = (function PDFPageViewClosure() {
var CustomStyle = PDFJS.CustomStyle;
/**
* @constructs PDFPageView
* @param {PDFPageViewOptions} options
@@ -3460,7 +3454,7 @@ var PDFPageView = (function PDFPageViewClosure() {
var defaultViewport = options.defaultViewport;
var renderingQueue = options.renderingQueue;
var textLayerFactory = options.textLayerFactory;
var annotationsLayerFactory = options.annotationsLayerFactory;
var annotationLayerFactory = options.annotationLayerFactory;
this.id = id;
this.renderingId = 'page' + id;
@@ -3473,7 +3467,7 @@ var PDFPageView = (function PDFPageViewClosure() {
this.renderingQueue = renderingQueue;
this.textLayerFactory = textLayerFactory;
this.annotationsLayerFactory = annotationsLayerFactory;
this.annotationLayerFactory = annotationLayerFactory;
this.renderingState = RenderingStates.INITIAL;
this.resume = null;
@@ -3622,6 +3616,8 @@ var PDFPageView = (function PDFPageViewClosure() {
},
cssTransform: function PDFPageView_transform(canvas, redrawAnnotations) {
var CustomStyle = PDFJS.CustomStyle;
// Scale canvas, canvas wrapper, and page container.
var width = this.viewport.width;
var height = this.viewport.height;
@@ -3686,7 +3682,7 @@ var PDFPageView = (function PDFPageViewClosure() {
}
if (redrawAnnotations && this.annotationLayer) {
this.annotationLayer.setupAnnotations(this.viewport, 'display');
this.annotationLayer.render(this.viewport, 'display');
}
},
@@ -3902,12 +3898,12 @@ var PDFPageView = (function PDFPageViewClosure() {
}
);
if (this.annotationsLayerFactory) {
if (this.annotationLayerFactory) {
if (!this.annotationLayer) {
this.annotationLayer = this.annotationsLayerFactory.
createAnnotationsLayerBuilder(div, this.pdfPage);
this.annotationLayer = this.annotationLayerFactory.
createAnnotationLayerBuilder(div, this.pdfPage);
}
this.annotationLayer.setupAnnotations(this.viewport, 'display');
this.annotationLayer.render(this.viewport, 'display');
}
div.setAttribute('data-loaded', true);
@@ -3918,6 +3914,7 @@ var PDFPageView = (function PDFPageViewClosure() {
},
beforePrint: function PDFPageView_beforePrint() {
var CustomStyle = PDFJS.CustomStyle;
var pdfPage = this.pdfPage;
var viewport = pdfPage.getViewport(1);
@@ -4296,7 +4293,7 @@ DefaultTextLayerFactory.prototype = {
/**
* @typedef {Object} AnnotationsLayerBuilderOptions
* @typedef {Object} AnnotationLayerBuilderOptions
* @property {HTMLDivElement} pageDiv
* @property {PDFPage} pdfPage
* @property {IPDFLinkService} linkService
@@ -4305,155 +4302,90 @@ DefaultTextLayerFactory.prototype = {
/**
* @class
*/
var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
var CustomStyle = PDFJS.CustomStyle;
var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() {
/**
* @param {AnnotationsLayerBuilderOptions} options
* @constructs AnnotationsLayerBuilder
* @param {AnnotationLayerBuilderOptions} options
* @constructs AnnotationLayerBuilder
*/
function AnnotationsLayerBuilder(options) {
function AnnotationLayerBuilder(options) {
this.pageDiv = options.pageDiv;
this.pdfPage = options.pdfPage;
this.linkService = options.linkService;
this.div = null;
}
AnnotationsLayerBuilder.prototype =
/** @lends AnnotationsLayerBuilder.prototype */ {
AnnotationLayerBuilder.prototype =
/** @lends AnnotationLayerBuilder.prototype */ {
/**
* @param {PageViewport} viewport
* @param {string} intent (default value is 'display')
*/
setupAnnotations:
function AnnotationsLayerBuilder_setupAnnotations(viewport, intent) {
function bindLink(link, dest) {
link.href = linkService.getDestinationHash(dest);
link.onclick = function annotationsLayerBuilderLinksOnclick() {
if (dest) {
linkService.navigateTo(dest);
}
return false;
};
if (dest) {
link.className = 'internalLink';
}
}
function bindNamedAction(link, action) {
link.href = linkService.getAnchorUrl('');
link.onclick = function annotationsLayerBuilderNamedActionOnClick() {
linkService.executeNamedAction(action);
return false;
};
link.className = 'internalLink';
}
var linkService = this.linkService;
var pdfPage = this.pdfPage;
render: function AnnotationLayerBuilder_render(viewport, intent) {
var self = this;
var getAnnotationsParams = {
var parameters = {
intent: (intent === undefined ? 'display' : intent),
};
pdfPage.getAnnotations(getAnnotationsParams).then(
function (annotationsData) {
this.pdfPage.getAnnotations(parameters).then(function (annotations) {
viewport = viewport.clone({ dontFlip: true });
var transform = viewport.transform;
var transformStr = 'matrix(' + transform.join(',') + ')';
var data, element, i, ii;
parameters = {
viewport: viewport,
div: self.div,
annotations: annotations,
page: self.pdfPage,
linkService: self.linkService
};
if (self.div) {
// If an annotationLayer already exists, refresh its children's
// transformation matrices
for (i = 0, ii = annotationsData.length; i < ii; i++) {
data = annotationsData[i];
element = self.div.querySelector(
'[data-annotation-id="' + data.id + '"]');
if (element) {
CustomStyle.setProp('transform', element, transformStr);
}
}
// See PDFPageView.reset()
self.div.removeAttribute('hidden');
// transformation matrices.
PDFJS.AnnotationLayer.update(parameters);
} else {
for (i = 0, ii = annotationsData.length; i < ii; i++) {
data = annotationsData[i];
if (!data || !data.hasHtml) {
continue;
}
// Create an annotation layer div and render the annotations
// if there is at least one annotation.
if (annotations.length === 0) {
return;
}
element = PDFJS.AnnotationUtils.getHtmlElement(data,
pdfPage.commonObjs);
element.setAttribute('data-annotation-id', data.id);
if (typeof mozL10n !== 'undefined') {
mozL10n.translate(element);
}
self.div = document.createElement('div');
self.div.className = 'annotationLayer';
self.pageDiv.appendChild(self.div);
parameters.div = self.div;
var rect = data.rect;
var view = pdfPage.view;
rect = PDFJS.Util.normalizeRect([
rect[0],
view[3] - rect[1] + view[1],
rect[2],
view[3] - rect[3] + view[1]
]);
element.style.left = rect[0] + 'px';
element.style.top = rect[1] + 'px';
element.style.position = 'absolute';
CustomStyle.setProp('transform', element, transformStr);
var transformOriginStr = -rect[0] + 'px ' + -rect[1] + 'px';
CustomStyle.setProp('transformOrigin', element, transformOriginStr);
if (data.subtype === 'Link' && !data.url) {
var link = element.getElementsByTagName('a')[0];
if (link) {
if (data.action) {
bindNamedAction(link, data.action);
} else {
bindLink(link, ('dest' in data) ? data.dest : null);
}
}
}
if (!self.div) {
var annotationLayerDiv = document.createElement('div');
annotationLayerDiv.className = 'annotationLayer';
self.pageDiv.appendChild(annotationLayerDiv);
self.div = annotationLayerDiv;
}
self.div.appendChild(element);
PDFJS.AnnotationLayer.render(parameters);
if (typeof mozL10n !== 'undefined') {
mozL10n.translate(self.div);
}
}
});
},
hide: function () {
hide: function AnnotationLayerBuilder_hide() {
if (!this.div) {
return;
}
this.div.setAttribute('hidden', 'true');
}
};
return AnnotationsLayerBuilder;
return AnnotationLayerBuilder;
})();
/**
* @constructor
* @implements IPDFAnnotationsLayerFactory
* @implements IPDFAnnotationLayerFactory
*/
function DefaultAnnotationsLayerFactory() {}
DefaultAnnotationsLayerFactory.prototype = {
function DefaultAnnotationLayerFactory() {}
DefaultAnnotationLayerFactory.prototype = {
/**
* @param {HTMLDivElement} pageDiv
* @param {PDFPage} pdfPage
* @returns {AnnotationsLayerBuilder}
* @returns {AnnotationLayerBuilder}
*/
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
return new AnnotationsLayerBuilder({
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
return new AnnotationLayerBuilder({
pageDiv: pageDiv,
pdfPage: pdfPage,
linkService: new SimpleLinkService(),
@@ -4721,7 +4653,7 @@ var PDFViewer = (function pdfViewer() {
defaultViewport: viewport.clone(),
renderingQueue: this.renderingQueue,
textLayerFactory: textLayerFactory,
annotationsLayerFactory: this
annotationLayerFactory: this
});
bindOnAfterAndBeforeDraw(pageView);
this._pages.push(pageView);
@@ -5178,10 +5110,10 @@ var PDFViewer = (function pdfViewer() {
/**
* @param {HTMLDivElement} pageDiv
* @param {PDFPage} pdfPage
* @returns {AnnotationsLayerBuilder}
* @returns {AnnotationLayerBuilder}
*/
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
return new AnnotationsLayerBuilder({
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
return new AnnotationLayerBuilder({
pageDiv: pageDiv,
pdfPage: pdfPage,
linkService: this.linkService
@@ -5890,7 +5822,7 @@ var PDFOutlineView = (function PDFOutlineViewClosure() {
div.className = 'outlineItem';
var element = document.createElement('a');
this._bindLink(element, item);
element.textContent = removeNullCharacters(item.title);
element.textContent = PDFJS.removeNullCharacters(item.title);
div.appendChild(element);
if (item.items.length > 0) {
@@ -5994,7 +5926,7 @@ var PDFAttachmentView = (function PDFAttachmentViewClosure() {
div.className = 'attachmentsItem';
var button = document.createElement('button');
this._bindLink(button, item.content, filename);
button.textContent = removeNullCharacters(filename);
button.textContent = PDFJS.removeNullCharacters(filename);
div.appendChild(button);
this.container.appendChild(div);
}
@@ -7162,7 +7094,8 @@ var PDFViewerApplication = {
function webViewerLoad(evt) {
PDFViewerApplication.initialize().then(webViewerInitialized);
configure(PDFJS);
PDFViewerApplication.initialize().then(webViewerInitialized);
}
function webViewerInitialized() {
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
requestLongerTimeout(2);
Components.utils.import("resource://gre/modules/Promise.jsm", this);
const RELATIVE_DIR = "browser/extensions/pdfjs/test/";
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
requestLongerTimeout(2);
Components.utils.import("resource://gre/modules/Promise.jsm", this);
const RELATIVE_DIR = "browser/extensions/pdfjs/test/";
@@ -629,10 +629,8 @@ readingList.promo.firstUse.readerView.body = Remove clutter so you can focus exa
# e10s.postActivationInfobar.learnMore.label
# e10s.postActivationInfobar.learnMore.accesskey
# e10s.accessibilityNotice.mainMessage
# e10s.accessibilityNotice.disableAndRestart.label
# e10s.accessibilityNotice.disableAndRestart.accesskey
# e10s.accessibilityNotice.dontDisable.label
# e10s.accessibilityNotice.dontDisable.accesskey):
# e10s.accessibilityNotice.enableAndRestart.label
# e10s.accessibilityNotice.enableAndRestart.accesskey
# These strings are related to the messages we display to offer e10s (Multi-process) to users
# on the pre-release channels. They won't be used in release but they will likely be used in
# beta starting from version 41, so it's still useful to have these strings properly localized.
@@ -644,14 +642,11 @@ e10s.offerPopup.enableAndRestart.label = Enable and Restart
e10s.offerPopup.enableAndRestart.accesskey = E
e10s.offerPopup.noThanks.label = No, thanks
e10s.offerPopup.noThanks.accesskey = N
e10s.postActivationInfobar.message = You're now helping to test multi-process in %S! Please report problems you find.
e10s.postActivationInfobar.learnMore.label = Learn More
e10s.postActivationInfobar.learnMore.accesskey = L
e10s.accessibilityNotice.mainMessage = Multi-process does not yet support accessibility features. Multi-process will be disabled if you restart %S. Would you like to restart?
e10s.accessibilityNotice.disableAndRestart.label = Disable and Restart
e10s.accessibilityNotice.disableAndRestart.accesskey = R
e10s.accessibilityNotice.dontDisable.label = Don't Disable
e10s.accessibilityNotice.dontDisable.accesskey = D
e10s.accessibilityNotice.mainMessage2 = Accessibility support is partially disabled due to compatibility issues with new %S features.
e10s.accessibilityNotice.acceptButton.label = Ok
e10s.accessibilityNotice.acceptButton.accesskey = O
e10s.accessibilityNotice.enableAndRestart.label = Enable (Requires Restart)
e10s.accessibilityNotice.enableAndRestart.accesskey = E
muteTab.label = Mute Tab
muteTab.accesskey = M
-66
View File
@@ -294,8 +294,6 @@ PluginContent.prototype = {
return "PluginVulnerableUpdatable";
case Ci.nsIObjectLoadingContent.PLUGIN_VULNERABLE_NO_UPDATE:
return "PluginVulnerableNoUpdate";
case Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW:
return "PluginPlayPreview";
default:
// Not all states map to a handler
return null;
@@ -413,10 +411,6 @@ PluginContent.prototype = {
shouldShowNotification = true;
break;
case "PluginPlayPreview":
this._handlePlayPreviewEvent(plugin);
break;
case "PluginDisabled":
let manageLink = this.getPluginUI(plugin, "managePluginsLink");
this.addLinkClickCallback(manageLink, "forwardCallback", "managePlugins");
@@ -526,12 +520,6 @@ PluginContent.prototype = {
objLoadingContent.pluginFallbackType >= Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY &&
objLoadingContent.pluginFallbackType <= Ci.nsIObjectLoadingContent.PLUGIN_VULNERABLE_NO_UPDATE;
if (objLoadingContent.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW) {
// checking if play preview is subject to CTP rules
let playPreviewInfo = pluginHost.getPlayPreviewInfo(objLoadingContent.actualType);
isFallbackTypeValid = !playPreviewInfo.ignoreCTP;
}
return !objLoadingContent.activated &&
pluginPermission != Ci.nsIPermissionManager.DENY_ACTION &&
isFallbackTypeValid;
@@ -544,17 +532,6 @@ PluginContent.prototype = {
}
},
stopPlayPreview: function (plugin, playPlugin) {
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
if (objLoadingContent.activated)
return;
if (playPlugin)
objLoadingContent.playPlugin();
else
objLoadingContent.cancelPlayPreview();
},
// Callback for user clicking on a missing (unsupported) plugin.
installSinglePlugin: function (plugin) {
this.global.sendAsyncMessage("PluginContent:InstallSinglePlugin", {
@@ -647,49 +624,6 @@ PluginContent.prototype = {
}
},
_handlePlayPreviewEvent: function (plugin) {
let doc = plugin.ownerDocument;
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
let pluginInfo = this._getPluginInfo(plugin);
let playPreviewInfo = pluginHost.getPlayPreviewInfo(pluginInfo.mimetype);
let previewContent = this.getPluginUI(plugin, "previewPluginContent");
let iframe = previewContent.getElementsByClassName("previewPluginContentFrame")[0];
if (!iframe) {
// lazy initialization of the iframe
iframe = doc.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
iframe.className = "previewPluginContentFrame";
previewContent.appendChild(iframe);
// Force a style flush, so that we ensure our binding is attached.
plugin.clientTop;
}
iframe.src = playPreviewInfo.redirectURL;
// MozPlayPlugin event can be dispatched from the extension chrome
// code to replace the preview content with the native plugin
let playPluginHandler = (event) => {
if (!event.isTrusted)
return;
previewContent.removeEventListener("MozPlayPlugin", playPluginHandler, true);
let playPlugin = !event.detail;
this.stopPlayPreview(plugin, playPlugin);
// cleaning up: removes overlay iframe from the DOM
let iframe = previewContent.getElementsByClassName("previewPluginContentFrame")[0];
if (iframe)
previewContent.removeChild(iframe);
};
previewContent.addEventListener("MozPlayPlugin", playPluginHandler, true);
if (!playPreviewInfo.ignoreCTP) {
this._showClickToPlayNotification(plugin, false);
}
},
reshowClickToPlayNotification: function () {
let contentWindow = this.global.content;
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
+1
View File
@@ -38,6 +38,7 @@ EXTRA_JS_MODULES += [
'SharedFrame.jsm',
'SitePermissions.jsm',
'TabCrashReporter.jsm',
'TabGroupsMigrator.jsm',
'TransientPrefs.jsm',
'WebappManager.jsm',
'webrtcUI.jsm',
+3 -11
View File
@@ -25,7 +25,7 @@ class nsNPAPIPluginInstance;
* interface to mirror this interface when changing it.
*/
[scriptable, uuid(5efbd411-5bbe-4de1-9f3a-1c3459696eb2)]
[scriptable, uuid(2eb3195e-3eea-4083-bb1d-d2d70fa35ccb)]
interface nsIObjectLoadingContent : nsISupports
{
/**
@@ -65,8 +65,6 @@ interface nsIObjectLoadingContent : nsISupports
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
// The plugin is vulnerable (no update available)
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
// The plugin is in play preview mode
const unsigned long PLUGIN_PLAY_PREVIEW = 11;
/**
* The actual mime type (the one we got back from the network
@@ -128,8 +126,7 @@ interface nsIObjectLoadingContent : nsISupports
in boolean submittedCrashReport);
/**
* This method will play a plugin that has been stopped by the
* click-to-play plugins or play-preview features.
* This method will play a plugin that has been stopped by click-to-play.
*/
void playPlugin();
@@ -144,7 +141,7 @@ interface nsIObjectLoadingContent : nsISupports
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be
* click-to-play or play-preview.
* click-to-play.
*/
readonly attribute boolean activated;
@@ -184,11 +181,6 @@ interface nsIObjectLoadingContent : nsISupports
*/
readonly attribute bool hasRunningPlugin;
/**
* This method will disable the play-preview plugin state.
*/
void cancelPlayPreview();
/**
* If this plugin runs out-of-process, it has a runID to differentiate
* between different times the plugin process has been instantiated.
+4 -56
View File
@@ -709,7 +709,6 @@ nsObjectLoadingContent::nsObjectLoadingContent()
, mInstantiating(false)
, mNetworkCreated(true)
, mActivated(false)
, mPlayPreviewCanceled(false)
, mIsStopping(false)
, mIsLoading(false)
, mScriptRequested(false) {}
@@ -1411,8 +1410,6 @@ nsObjectLoadingContent::ObjectState() const
return NS_EVENT_STATE_USERDISABLED;
case eFallbackClickToPlay:
return NS_EVENT_STATE_TYPE_CLICK_TO_PLAY;
case eFallbackPlayPreview:
return NS_EVENT_STATE_TYPE_PLAY_PREVIEW;
case eFallbackDisabled:
return NS_EVENT_STATE_BROKEN | NS_EVENT_STATE_HANDLER_DISABLED;
case eFallbackBlocklisted:
@@ -3112,7 +3109,7 @@ nsObjectLoadingContent::PlayPlugin()
LOG(("OBJLC [%p]: Activated by user", this));
}
// If we're in a click-to-play or play preview state, we need to reload
// If we're in a click-to-play state, reload.
// Fallback types >= eFallbackClickToPlay are plugin-replacement types, see
// header
if (mType == eType_Null && mFallbackType >= eFallbackClickToPlay) {
@@ -3127,7 +3124,6 @@ nsObjectLoadingContent::Reload(bool aClearActivation)
{
if (aClearActivation) {
mActivated = false;
mPlayPreviewCanceled = false;
}
return LoadObject(true, true);
@@ -3167,22 +3163,6 @@ nsObjectLoadingContent::GetHasRunningPlugin(bool *aHasPlugin)
return NS_OK;
}
NS_IMETHODIMP
nsObjectLoadingContent::CancelPlayPreview()
{
if (!nsContentUtils::IsCallerChrome())
return NS_ERROR_NOT_AVAILABLE;
mPlayPreviewCanceled = true;
// If we're in play preview state already, reload
if (mType == eType_Null && mFallbackType == eFallbackPlayPreview) {
return LoadObject(true, true);
}
return NS_OK;
}
NS_IMETHODIMP
nsObjectLoadingContent::GetRunID(uint32_t* aRunID)
{
@@ -3233,31 +3213,6 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
nsCOMPtr<nsIPluginPlayPreviewInfo> playPreviewInfo;
bool isPlayPreviewSpecified = NS_SUCCEEDED(pluginHost->GetPlayPreviewInfo(
mContentType, getter_AddRefs(playPreviewInfo)));
if (isPlayPreviewSpecified) {
// Checking PlayPreview whitelist as well.
nsCString uriSpec, baseSpec;
if (mURI) {
mURI->GetSpec(uriSpec);
}
if (mBaseURI) {
mBaseURI->GetSpec(baseSpec);
}
playPreviewInfo->CheckWhitelist(baseSpec, uriSpec, &isPlayPreviewSpecified);
}
bool ignoreCTP = false;
if (isPlayPreviewSpecified) {
playPreviewInfo->GetIgnoreCTP(&ignoreCTP);
}
if (isPlayPreviewSpecified && !mPlayPreviewCanceled &&
ignoreCTP) {
// play preview in ignoreCTP mode is shown even if the native plugin
// is not present/installed
aReason = eFallbackPlayPreview;
return false;
}
// at this point if it's not a plugin, we let it play/fallback
if (!aIgnoreCurrentType && mType != eType_Plugin) {
return true;
@@ -3267,8 +3222,6 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
// * Assume a default of click-to-play
// * If globally disabled, per-site permissions cannot override.
// * If blocklisted, override the reason with the blocklist reason
// * If not blocklisted but playPreview, override the reason with the
// playPreview reason.
// * Check per-site permissions and follow those if specified.
// * Honor per-plugin disabled permission
// * Blocklisted plugins are forced to CtP
@@ -3285,8 +3238,9 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
}
// Before we check permissions, get the blocklist state of this plugin to set
// the fallback reason correctly.
uint32_t blocklistState = nsIBlocklistService::STATE_NOT_BLOCKED;
// the fallback reason correctly. In the content process this will involve
// an ipc call to chrome.
uint32_t blocklistState = nsIBlocklistService::STATE_BLOCKED;
pluginHost->GetBlocklistStateForType(mContentType,
nsPluginHost::eExcludeNone,
&blocklistState);
@@ -3303,12 +3257,6 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
aReason = eFallbackVulnerableNoUpdate;
}
if (aReason == eFallbackClickToPlay && isPlayPreviewSpecified &&
!mPlayPreviewCanceled && !ignoreCTP) {
// play preview in click-to-play mode is shown instead of standard CTP UI
aReason = eFallbackPlayPreview;
}
// Check the permission manager for permission based on the principal of
// the toplevel content.
+1 -11
View File
@@ -94,9 +94,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent
eFallbackVulnerableUpdatable = nsIObjectLoadingContent::PLUGIN_VULNERABLE_UPDATABLE,
// The plugin is vulnerable (no update available)
eFallbackVulnerableNoUpdate = nsIObjectLoadingContent::PLUGIN_VULNERABLE_NO_UPDATE,
// The plugin is disabled and play preview content is displayed until
// the extension code enables it by sending the MozPlayPlugin event
eFallbackPlayPreview = nsIObjectLoadingContent::PLUGIN_PLAY_PREVIEW
};
nsObjectLoadingContent();
@@ -225,10 +222,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent
{
return !!mInstanceOwner;
}
void CancelPlayPreview(mozilla::ErrorResult& aRv)
{
aRv = CancelPlayPreview();
}
void SwapFrameLoaders(nsXULElement& aOtherOwner, mozilla::ErrorResult& aRv)
{
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
@@ -622,16 +615,13 @@ class nsObjectLoadingContent : public nsImageLoadingContent
// activated by PlayPlugin(). (see ShouldPlay())
bool mActivated : 1;
// Used to keep track of whether or not a plugin is blocked by play-preview.
bool mPlayPreviewCanceled : 1;
// Protects DoStopPlugin from reentry (bug 724781).
bool mIsStopping : 1;
// Protects LoadObject from re-entry
bool mIsLoading : 1;
// For plugin stand-in types (click-to-play, play preview, ...) tracks
// For plugin stand-in types (click-to-play) tracks
// whether content js has tried to access the plugin script object.
bool mScriptRequested : 1;
-2
View File
@@ -262,8 +262,6 @@ private:
#define NS_EVENT_STATE_LTR NS_DEFINE_EVENT_STATE_MACRO(42)
// Element is rtl (for :dir pseudo-class)
#define NS_EVENT_STATE_RTL NS_DEFINE_EVENT_STATE_MACRO(43)
// Handler for play preview plugin
#define NS_EVENT_STATE_TYPE_PLAY_PREVIEW NS_DEFINE_EVENT_STATE_MACRO(44)
// Element is highlighted (devtools inspector)
#define NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED NS_DEFINE_EVENT_STATE_MACRO(45)
// Element is an unresolved custom element candidate
+7 -9
View File
@@ -830,14 +830,14 @@ class WorkerPermissionChallenge;
// This class calles WorkerPermissionChallenge::OperationCompleted() in the
// worker thread.
class WorkerPermissionOperationCompleted final : public WorkerRunnable
class WorkerPermissionOperationCompleted final : public WorkerControlRunnable
{
RefPtr<WorkerPermissionChallenge> mChallenge;
public:
WorkerPermissionOperationCompleted(WorkerPrivate* aWorkerPrivate,
WorkerPermissionChallenge* aChallenge)
: WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
: WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
, mChallenge(aChallenge)
{
MOZ_ASSERT(NS_IsMainThread());
@@ -943,11 +943,7 @@ public:
RefPtr<WorkerPermissionOperationCompleted> runnable =
new WorkerPermissionOperationCompleted(mWorkerPrivate, this);
if (!runnable->Dispatch(nullptr)) {
NS_WARNING("Failed to dispatch a runnable to the worker thread.");
return;
}
MOZ_ALWAYS_TRUE(runnable->Dispatch(nullptr));
return;
}
@@ -1419,7 +1415,7 @@ BackgroundFactoryRequestChild::RecvPermissionChallenge(
JSContext* cx = workerPrivate->GetJSContext();
MOZ_ASSERT(cx);
if (!workerPrivate->AddFeature(cx, challenge)) {
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, challenge))) {
return false;
}
@@ -1441,7 +1437,9 @@ BackgroundFactoryRequestChild::RecvPermissionChallenge(
nsCOMPtr<Element> ownerElement =
do_QueryInterface(window->GetChromeEventHandler());
if (NS_WARN_IF(!ownerElement)) {
return false;
// If this fails, the page was navigated. Fail the permission check by
// forcing an immediate retry.
return SendPermissionRetry();
}
RefPtr<PermissionRequestMainProcessHelper> helper =
+13 -11
View File
@@ -132,10 +132,8 @@ IDBFactory::CreateForWindow(nsPIDOMWindowInner* aWindow,
if (!(NS_SUCCEEDED(rv) && nsContentUtils::IsSystemPrincipal(principal)) &&
NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
// IndexedDB is disabled and the caller is content.
NS_WARNING("An attempt to use IndexedDB was made, but it is not enabled.");
*aFactory = nullptr;
return NS_OK;
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
if (rv == NS_ERROR_DOM_NOT_SUPPORTED_ERR) {
@@ -682,8 +680,6 @@ IDBFactory::OpenInternal(nsIPrincipal* aPrincipal,
}
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
// We need to start the sequence to create a background actor for this
// thread.
BackgroundChildImpl::ThreadLocal* threadLocal =
BackgroundChildImpl::GetThreadLocalForCurrentThread();
@@ -703,12 +699,18 @@ IDBFactory::OpenInternal(nsIPrincipal* aPrincipal,
newIDBThreadLocal = idbThreadLocal = new ThreadLocal(id);
}
RefPtr<BackgroundCreateCallback> cb =
new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
IDB_REPORT_INTERNAL_ERR();
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
return nullptr;
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
BackgroundActorCreated(actor, idbThreadLocal->GetLoggingInfo());
} else {
// We need to start the sequence to create a background actor for this
// thread.
RefPtr<BackgroundCreateCallback> cb =
new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
IDB_REPORT_INTERNAL_ERR();
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
return nullptr;
}
}
if (newIDBThreadLocal) {
-2
View File
@@ -30,7 +30,6 @@ EXPORTS += [
'nsPluginLogging.h',
'nsPluginNativeWindow.h',
'nsPluginNativeWindowGtk.h',
'nsPluginPlayPreviewInfo.h',
'nsPluginsCID.h',
'nsPluginsDir.h',
'nsPluginTags.h',
@@ -46,7 +45,6 @@ UNIFIED_SOURCES += [
'nsNPAPIPluginStreamListener.cpp',
'nsPluginInstanceOwner.cpp',
'nsPluginModule.cpp',
'nsPluginPlayPreviewInfo.cpp',
'nsPluginStreamListenerPeer.cpp',
'nsPluginTags.cpp',
'PluginPRLibrary.cpp',
+1 -43
View File
@@ -12,21 +12,6 @@
"@mozilla.org/plugin/host;1"
%}
[scriptable, uuid(57069ada-2845-46ef-b57f-233596d1c02c)]
interface nsIPluginPlayPreviewInfo : nsISupports
{
readonly attribute AUTF8String mimeType;
readonly attribute boolean ignoreCTP;
readonly attribute AUTF8String redirectURL;
readonly attribute AUTF8String whitelist;
/**
* Checks if pageURI and objectURI matches once of the entries in
* the whitelist. If whitelist is empty, returns true.
*/
boolean checkWhitelist(in AUTF8String pageURI, in AUTF8String objectURI);
};
[scriptable, function, uuid(9c311778-7c2c-4ad8-b439-b8a2786a20dd)]
interface nsIClearSiteDataCallback : nsISupports
{
@@ -36,7 +21,7 @@ interface nsIClearSiteDataCallback : nsISupports
void callback(in nsresult rv);
};
[scriptable, uuid(50677599-323f-4c7d-a450-307bdb7acbf0)]
[scriptable, uuid(f938f5ba-7093-42cd-a559-af8039d99204)]
interface nsIPluginHost : nsISupports
{
/**
@@ -102,27 +87,6 @@ interface nsIPluginHost : nsISupports
*/
boolean siteHasData(in nsIPluginTag plugin, in AUTF8String domain);
/**
* Registers the play preview plugin mode for specific mime type
*
* @param mimeType: specifies plugin mime type.
* @param ignoreCTP: if true, the play preview ignores CTP rules, e.g.
whitelisted websites, will not notify about plugin
presence in the address bar.
* @param redirectURL: specifies url for the overlay iframe
* @param whitelist: specifies plugin whitelist in form of comma separated
* "[@page_url object_url|@page_url|object_url]" entries,
* e.g. @http://example.org/* http://example.org/t.swf
*/
void registerPlayPreviewMimeType(in AUTF8String mimeType,
[optional] in boolean ignoreCTP,
[optional] in AUTF8String redirectURL,
[optional] in AUTF8String whitelist);
void unregisterPlayPreviewMimeType(in AUTF8String mimeType);
nsIPluginPlayPreviewInfo getPlayPreviewInfo(in AUTF8String mimeType);
/**
* Get the "permission string" for the plugin. This is a string that can be
* passed to the permission manager to see whether the plugin is allowed to
@@ -193,10 +157,4 @@ interface nsIPluginHost : nsISupports
* passed in the FakePluginTagInit when registering.
*/
void unregisterFakePlugin(in AUTF8String handlerURI);
/**
* Returns true if plugins with the given mimetype will run out of process.
*/
boolean isPluginOOP(in AUTF8String aMimeType);
};
+32 -73
View File
@@ -109,6 +109,10 @@
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#endif
#if MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "npapi.h"
using namespace mozilla;
@@ -245,6 +249,11 @@ IsTypeInList(const nsCString& aMimeType, nsCString aTypeList)
commaSeparated += aMimeType;
commaSeparated.Append(',');
// Lower-case the search string and MIME type to properly handle a mixed-case
// type, as MIME types are case insensitive.
ToLowerCase(searchStr);
ToLowerCase(commaSeparated);
return FindInReadable(commaSeparated, start, end);
}
@@ -968,6 +977,12 @@ nsPluginHost::TrySetUpPluginInstance(const nsACString &aMimeType,
plugin->GetLibrary()->SetHasLocalInstance();
#if defined(MOZ_WIDGET_ANDROID) && defined(MOZ_CRASHREPORTER)
if (pluginTag->mIsFlashPlugin) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FlashVersion"), pluginTag->Version());
}
#endif
RefPtr<nsNPAPIPluginInstance> instance = new nsNPAPIPluginInstance();
// This will create the owning reference. The connection must be made between the
@@ -1082,18 +1097,6 @@ nsPluginHost::GetBlocklistStateForType(const nsACString &aMimeType,
return tag->GetBlocklistState(aState);
}
NS_IMETHODIMP
nsPluginHost::IsPluginOOP(const nsACString& aMimeType,
bool* aResult)
{
nsPluginTag* tag = FindNativePluginForType(aMimeType, true);
if (!tag) {
return NS_ERROR_NOT_AVAILABLE;
}
*aResult = nsNPAPIPlugin::RunPluginOOP(tag);
return NS_OK;
}
NS_IMETHODIMP
nsPluginHost::GetPermissionStringForType(const nsACString &aMimeType,
uint32_t aExcludeFlags,
@@ -1372,6 +1375,13 @@ nsPluginHost::GetPluginForContentProcess(uint32_t aPluginId, nsNPAPIPlugin** aPl
nsPluginTag* pluginTag = PluginWithId(aPluginId);
if (pluginTag) {
// When setting up a bridge, double check with chrome to see if this plugin
// is blocked hard. Note this does not protect against vulnerable plugins
// that the user has explicitly allowed. :(
if (pluginTag->IsBlocklisted()) {
return NS_ERROR_PLUGIN_BLOCKLISTED;
}
nsresult rv = EnsurePluginLoaded(pluginTag);
if (NS_FAILED(rv)) {
return rv;
@@ -1610,58 +1620,6 @@ nsPluginHost::UnregisterFakePlugin(const nsACString& aHandlerURI)
return NS_OK;
}
NS_IMETHODIMP
nsPluginHost::RegisterPlayPreviewMimeType(const nsACString& mimeType,
bool ignoreCTP,
const nsACString& redirectURL,
const nsACString& whitelist)
{
nsAutoCString mt(mimeType);
nsAutoCString url(redirectURL);
if (url.Length() == 0) {
// using default play preview iframe URL, if redirectURL is not specified
url.AssignLiteral("data:application/x-moz-playpreview;,");
url.Append(mimeType);
}
nsAutoCString wl(whitelist);
RefPtr<nsPluginPlayPreviewInfo> playPreview =
new nsPluginPlayPreviewInfo(mt.get(), ignoreCTP, url.get(), wl.get());
mPlayPreviewMimeTypes.AppendElement(playPreview);
return NS_OK;
}
NS_IMETHODIMP
nsPluginHost::UnregisterPlayPreviewMimeType(const nsACString& mimeType)
{
nsAutoCString mimeTypeToRemove(mimeType);
for (uint32_t i = mPlayPreviewMimeTypes.Length(); i > 0; i--) {
RefPtr<nsPluginPlayPreviewInfo> pp = mPlayPreviewMimeTypes[i - 1];
if (PL_strcasecmp(pp.get()->mMimeType.get(), mimeTypeToRemove.get()) == 0) {
mPlayPreviewMimeTypes.RemoveElementAt(i - 1);
break;
}
}
return NS_OK;
}
NS_IMETHODIMP
nsPluginHost::GetPlayPreviewInfo(const nsACString& mimeType,
nsIPluginPlayPreviewInfo** aResult)
{
nsAutoCString mimeTypeToFind(mimeType);
for (uint32_t i = 0; i < mPlayPreviewMimeTypes.Length(); i++) {
RefPtr<nsPluginPlayPreviewInfo> pp = mPlayPreviewMimeTypes[i];
if (PL_strcasecmp(pp.get()->mMimeType.get(), mimeTypeToFind.get()) == 0) {
*aResult = new nsPluginPlayPreviewInfo(pp.get());
NS_ADDREF(*aResult);
return NS_OK;
}
}
*aResult = nullptr;
return NS_ERROR_NOT_AVAILABLE;
}
// FIXME-jsplugins Is this method actually needed?
NS_IMETHODIMP
nsPluginHost::GetFakePlugin(const nsACString & aMimeType,
@@ -1892,7 +1850,8 @@ nsPluginHost::GetSpecialType(const nsACString & aMIMEType)
}
if (aMIMEType.LowerCaseEqualsASCII("application/x-shockwave-flash") ||
aMIMEType.LowerCaseEqualsASCII("application/futuresplash")) {
aMIMEType.LowerCaseEqualsASCII("application/futuresplash") ||
aMIMEType.LowerCaseEqualsASCII("application/x-shockwave-flash-test")) {
return eSpecialType_Flash;
}
@@ -2078,13 +2037,19 @@ bool
nsPluginHost::ShouldAddPlugin(nsPluginTag* aPluginTag)
{
#if 0 && defined(XP_WIN) && (defined(__x86_64__) || defined(_M_X64))
// On 64-bit windows, the only plugin we should load is flash. Use library
// filename and MIME type to check.
// On 64-bit windows, the only plugins we should load are flash and
// silverlight. Use library filename and MIME type to check.
if (StringBeginsWith(aPluginTag->FileName(), NS_LITERAL_CSTRING("NPSWF"), nsCaseInsensitiveCStringComparator()) &&
(aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-shockwave-flash")) ||
aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-shockwave-flash-test")))) {
return true;
}
if (StringBeginsWith(aPluginTag->FileName(), NS_LITERAL_CSTRING("npctrl"), nsCaseInsensitiveCStringComparator()) &&
(aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-silverlight-test")) ||
aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-silverlight-2")) ||
aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-silverlight")))) {
return true;
}
// Accept the test plugin MIME types, so mochitests still work.
if (aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-test")) ||
aPluginTag->HasMimeType(NS_LITERAL_CSTRING("application/x-Second-Test")) ||
@@ -2725,12 +2690,6 @@ nsPluginHost::FindPluginsForContent(uint32_t aPluginEpoch,
/// to be more sane and avoid this dance
nsPluginTag *tag = static_cast<nsPluginTag *>(basetag.get());
if (!nsNPAPIPlugin::RunPluginOOP(tag)) {
// Don't expose non-OOP plugins to content processes since we have no way
// to bridge them over.
continue;
}
aPlugins->AppendElement(PluginTag(tag->mId,
tag->Name(),
tag->Description(),
-2
View File
@@ -12,7 +12,6 @@
#include "prlink.h"
#include "prclist.h"
#include "nsIPluginTag.h"
#include "nsPluginPlayPreviewInfo.h"
#include "nsPluginsDir.h"
#include "nsPluginDirServiceProvider.h"
#include "nsAutoPtr.h"
@@ -378,7 +377,6 @@ private:
RefPtr<nsPluginTag> mPlugins;
RefPtr<nsPluginTag> mCachedPlugins;
RefPtr<nsInvalidPluginTag> mInvalidPlugins;
nsTArray< RefPtr<nsPluginPlayPreviewInfo> > mPlayPreviewMimeTypes;
nsTArray< RefPtr<nsFakePluginTag> > mFakePlugins;
@@ -1,154 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsPluginPlayPreviewInfo.h"
#include "nsWildCard.h"
using namespace mozilla;
nsPluginPlayPreviewInfo::nsPluginPlayPreviewInfo(const char* aMimeType,
bool aIgnoreCTP,
const char* aRedirectURL,
const char* aWhitelist)
: mMimeType(aMimeType), mIgnoreCTP(aIgnoreCTP), mRedirectURL(aRedirectURL),
mWhitelist(aWhitelist) {}
nsPluginPlayPreviewInfo::nsPluginPlayPreviewInfo(
const nsPluginPlayPreviewInfo* aSource)
{
MOZ_ASSERT(aSource);
mMimeType = aSource->mMimeType;
mIgnoreCTP = aSource->mIgnoreCTP;
mRedirectURL = aSource->mRedirectURL;
mWhitelist = aSource->mWhitelist;
}
nsPluginPlayPreviewInfo::~nsPluginPlayPreviewInfo()
{
}
NS_IMPL_ISUPPORTS(nsPluginPlayPreviewInfo, nsIPluginPlayPreviewInfo)
NS_IMETHODIMP
nsPluginPlayPreviewInfo::GetMimeType(nsACString& aMimeType)
{
aMimeType = mMimeType;
return NS_OK;
}
NS_IMETHODIMP
nsPluginPlayPreviewInfo::GetIgnoreCTP(bool* aIgnoreCTP)
{
*aIgnoreCTP = mIgnoreCTP;
return NS_OK;
}
NS_IMETHODIMP
nsPluginPlayPreviewInfo::GetRedirectURL(nsACString& aRedirectURL)
{
aRedirectURL = mRedirectURL;
return NS_OK;
}
NS_IMETHODIMP
nsPluginPlayPreviewInfo::GetWhitelist(nsACString& aWhitelist)
{
aWhitelist = mWhitelist;
return NS_OK;
}
/* static */ nsresult
nsPluginPlayPreviewInfo::CheckWhitelist(const nsACString& aPageURI,
const nsACString& aObjectURI,
const nsACString& aWhitelist,
bool *_retval)
{
if (aWhitelist.Length() == 0) {
// Considering empty whitelist as '*' entry.
*_retval = true;
return NS_OK;
}
// Parses whitelist as comma separated entries of
// [@page_url object_url|@page_url|object_url]
// where page_url and object_url pattern matches for aPageURI
// and aObjectURI, and performs matching as the same time.
nsACString::const_iterator start, end;
aWhitelist.BeginReading(start);
aWhitelist.EndReading(end);
nsAutoCString pageURI(aPageURI);
nsAutoCString objectURI(aObjectURI);
nsACString::const_iterator pos = start, entryStart, entryEnd;
nsACString::const_iterator pagePatternStart, pagePatternEnd;
nsACString::const_iterator objectPatternStart, objectPatternEnd;
int matchResult;
bool matched, didMatching;
while (pos != end) {
matched = true;
didMatching = false;
entryStart = pos;
// Looking for end of the entry.
while (pos != end && *pos != ',') {
pos++;
}
entryEnd = pos;
if (entryStart != entryEnd && *entryStart == '@') {
// Pattern for aPageURL is found, finding a space or end of the entry.
pagePatternStart = entryStart;
pagePatternStart++;
pagePatternEnd = pagePatternStart;
while (pagePatternEnd != entryEnd && *pagePatternEnd != ' ') {
pagePatternEnd++;
}
nsAutoCString pagePattern(Substring(pagePatternStart, pagePatternEnd));
matchResult = NS_WildCardMatch(pageURI.get(), pagePattern.get(), true);
matched &= matchResult == MATCH;
didMatching = true;
objectPatternStart = pagePatternEnd;
} else {
objectPatternStart = entryStart;
}
while (objectPatternStart != entryEnd && *objectPatternStart == ' ') {
objectPatternStart++;
}
if (objectPatternStart != entryEnd) {
// Pattern for aObjectURL is found, removing trailing spaces.
objectPatternEnd = entryEnd;
--objectPatternEnd;
while (objectPatternStart != objectPatternEnd &&
*objectPatternEnd == ' ') {
objectPatternEnd--;
};
objectPatternEnd++;
nsAutoCString objectPattern(Substring(objectPatternStart,
objectPatternEnd));
matchResult = NS_WildCardMatch(objectURI.get(), objectPattern.get(), true);
matched &= matchResult == MATCH;
didMatching = true;
}
// Ignoring match result for empty entries.
if (didMatching && matched) {
*_retval = true;
return NS_OK;
}
if (pos == end) {
break;
}
pos++;
}
*_retval = false;
return NS_OK;
}
NS_IMETHODIMP
nsPluginPlayPreviewInfo::CheckWhitelist(const nsACString& aPageURI,
const nsACString& aObjectURI,
bool *_retval)
{
return CheckWhitelist(aPageURI, aObjectURI, mWhitelist, _retval);
}
@@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsPluginPlayPreviewInfo_h_
#define nsPluginPlayPreviewInfo_h_
#include "nsString.h"
#include "nsIPluginHost.h"
class nsPluginPlayPreviewInfo : public nsIPluginPlayPreviewInfo
{
virtual ~nsPluginPlayPreviewInfo();
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPLUGINPLAYPREVIEWINFO
nsPluginPlayPreviewInfo(const char* aMimeType,
bool aIgnoreCTP,
const char* aRedirectURL,
const char* aWhitelist);
explicit nsPluginPlayPreviewInfo(const nsPluginPlayPreviewInfo* aSource);
/** This function checks aPageURI and aObjectURI against the whitelist
* specified in aWhitelist. This is public static function because this
* whitelist checking code needs to be accessed without any instances of
* nsIPluginPlayPreviewInfo. In particular, the Shumway whitelist is
* obtained directly from prefs and compared using this code for telemetry
* purposes.
*/
static nsresult CheckWhitelist(const nsACString& aPageURI,
const nsACString& aObjectURI,
const nsACString& aWhitelist,
bool *_retval);
nsCString mMimeType;
bool mIgnoreCTP;
nsCString mRedirectURL;
nsCString mWhitelist;
};
#endif // nsPluginPlayPreviewInfo_h_
+1 -20
View File
@@ -178,26 +178,7 @@ PluginInstanceParent::InitMetadata(const nsACString& aMimeType,
return false;
}
nsCOMPtr<nsIURI> baseUri(owner->GetBaseURI());
nsresult rv = NS_MakeAbsoluteURI(mSrcAttribute, aSrcAttribute, baseUri);
if (NS_FAILED(rv)) {
return false;
}
// Check the whitelist
nsAutoCString baseUrlSpec;
rv = baseUri->GetSpec(baseUrlSpec);
if (NS_FAILED(rv)) {
return false;
}
auto whitelist = Preferences::GetCString(kShumwayWhitelistPref);
// Empty whitelist is interpreted by CheckWhitelist as "allow everything,"
// which is not valid for our use case and should be treated as a failure.
if (whitelist.IsEmpty()) {
return false;
}
rv = nsPluginPlayPreviewInfo::CheckWhitelist(baseUrlSpec, mSrcAttribute,
whitelist,
&mIsWhitelistedForShumway);
return NS_SUCCEEDED(rv);
return NS_SUCCEEDED(NS_MakeAbsoluteURI(mSrcAttribute, aSrcAttribute, baseUri));
}
void
+1 -1
View File
@@ -3,7 +3,7 @@ skip-if = (buildapp == 'b2g' || buildapp == 'mulet')
support-files =
hang_test.js
privatemode_perwindowpb.xul
utils.js
plugin-utils.js
[test_bug479979.xul]
[test_bug751809.html]
+5 -1
View File
@@ -20,7 +20,7 @@ support-files =
plugin_window.html
pluginstream.js
post.sjs
utils.js
plugin-utils.js
[test_GCrace.html]
[test_NPNVdocumentOrigin.html]
@@ -106,9 +106,13 @@ skip-if = e10s
[test_twostreams.html]
[test_windowed_invalidate.html]
skip-if = os != "win"
[test_windowless_flash.html]
skip-if = !(os == "win" && processor == "x86_64")
[test_windowless_ime.html]
skip-if = os != "win"
[test_visibility.html]
skip-if = toolkit == "cocoa"
[test_zero_opacity.html]
skip-if = e10s
[test_bug1165981.html]
skip-if = !(os == "win" && processor == "x86_64")
+1 -1
View File
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<body style="background-color: #88AAFF;">
<h1>This Page Has a Solid Plugin</h1>
<p><embed id="p" type="application/x-test" drawmode="solid" color="FFFF0000" width="200" height="200"></embed>
<!DOCTYPE html>
<html>
<body style="background-color: #88AAFF;">
<h1>This Page Has a Solid Plugin</h1>
<p><embed id="p" type="application/x-test" drawmode="solid" color="FFFF0000" width="200" height="200"></embed>
+1 -1
View File
@@ -3,7 +3,7 @@
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
<body onload="start()">
@@ -2,7 +2,7 @@
<head>
<title>Test NPNVdocumentOrigin</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body onload="runTest()">
<script class="testbody" type="application/javascript">
@@ -2,7 +2,7 @@
<head>
<title>Test NPPVpluginWantsAllNetworkStreams</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
@@ -3,7 +3,7 @@
<head>
<title>Bug 1092842</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body onload="startTest()">
@@ -0,0 +1,73 @@
<html>
<head>
<title>Bug 1165981 Test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="run()">
<script class="testbody" type="application/javascript">
"use strict";
SimpleTest.waitForExplicitFinish();
ok(SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Flash Test Plug-in"), "Should find allowed test flash plugin");
ok(SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Silverlight Test Plug-in"), "Should find allowed test silverlight plugin");
ok(!SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Third Test Plug-in"), "Should not find disallowed plugin");
function findPlugin(pluginName) {
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = navigator.plugins[i];
if (plugin.name === pluginName) {
return plugin;
}
}
return null;
}
function findMimeType(mimeTypeType) {
for (var i = 0; i < navigator.mimeTypes.length; i++) {
var mimeType = navigator.mimeTypes[i];
if (mimeType.type === mimeTypeType) {
return mimeType;
}
}
return null;
}
function run() {
var pluginElement = document.getElementById("plugin-flash");
is(pluginElement.identifierToStringTest("foo"), "foo", "Should be able to call a function provided by the plugin");
pluginElement = document.getElementById("plugin-silverlight");
is(pluginElement.identifierToStringTest("foo"), "foo", "Should be able to call a function provided by the plugin");
pluginElement = document.getElementById("disallowedPlugin");
is(typeof pluginElement.identifierToStringTest, "undefined", "Should NOT be able to call a function on a disallowed plugin");
ok(navigator.plugins["Flash Test Plug-in"], "Should have queried a plugin named 'Flash Test Plug-in'");
ok(navigator.plugins["Silverlight Test Plug-in"], "Should have queried a plugin named 'Silverlight Test Plug-in'");
ok(!navigator.plugins["Third Test Plug-in"], "Should NOT have queried a disallowed plugin named 'Third Test Plug-in'");
ok(findPlugin("Flash Test Plug-in"), "Should have found a plugin named 'Flash Test Plug-in'");
ok(findPlugin("Silverlight Test Plug-in"), "Should have found a plugin named 'Silverlight Test Plug-in'");
ok(!findPlugin("Third Test Plug-in"), "Should NOT found a disallowed plugin named 'Third Test Plug-in'");
ok(navigator.mimeTypes["application/x-shockwave-flash-test"], "Should have queried a MIME type named 'application/x-shockwave-flash-test'");
ok(navigator.mimeTypes["application/x-silverlight-test"], "Should have queried a MIME type named 'application/x-silverlight-test'");
ok(!navigator.mimeTypes["application/x-third-test"], "Should NOT have queried a disallowed type named 'application/x-third-test'");
ok(findMimeType("application/x-shockwave-flash-test"), "Should have found a MIME type named 'application/x-shockwave-flash-test'");
ok(findMimeType("application/x-silverlight-test"), "Should have found a MIME type named 'application/x-silverlight-test'");
ok(!findMimeType("application/x-third-test"), "Should NOT have found a disallowed MIME type named 'application/x-third-test'");
SimpleTest.finish();
}
</script>
<object id="plugin-flash" type="application/x-shockwave-flash-test" width=200 height=200></object>
<object id="plugin-silverlight" type="application/x-silverlight-test" width=200 height=200></object>
<object id="disallowedPlugin" type="application/x-third-test" width=200 height=200></object>
</body>
</html>
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 406541</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -6,7 +6,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<script class="testbody" type="application/javascript">
<![CDATA[
@@ -4,7 +4,7 @@
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body onload="setTimeout(runTests, 2000)">
@@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=539565
<title>Test #1 for Bug 539565</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script class="testbody" type="text/javascript">
@@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=539565
<title>Test #2 for Bug 539565</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script class="testbody" type="text/javascript">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 738396</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -4,7 +4,7 @@
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<script type="application/javascript;version=1.7">
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref("plugins.click_to_play", true);
@@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=771202
<meta charset="utf-8">
<title>Test for Bug 771202</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
@@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=777098
<meta charset="utf-8">
<title>Test for Bug 777098</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="go();">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 784131</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 813906</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 852315</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 854082</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 863792</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 967694</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -3,7 +3,7 @@
<head>
<title>Test for Bug 985859</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@@ -5,7 +5,7 @@
<title>Test for Bug 986930</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body>
<script class="testbody" type="application/javascript">
@@ -3,7 +3,7 @@
<title>NPAPI ClearSiteData/GetSitesWithData Functionality</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body>
<script type="application/javascript">
@@ -2,7 +2,7 @@
<head>
<title>NPCocoaEventFocusChanged Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@@ -2,7 +2,7 @@
<head>
<title>NPCocoaEventWindowFocusChanged Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@@ -6,7 +6,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
+1 -1
View File
@@ -2,7 +2,7 @@
<head>
<title>NPAPI Cookie Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body onload="runTests()">
@@ -3,7 +3,7 @@
<head>
<title>Test copying text from browser to plugin</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script class="testbody" type="text/javascript">
function runTests() {
@@ -1,7 +1,7 @@
<head>
<title>Plugin crashing in nested loop</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body>
<script class="testbody" type="application/javascript">
@@ -3,7 +3,7 @@
<title>NPObject [[DefaultValue]] implementation</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
+36 -36
View File
@@ -1,36 +1,36 @@
<html>
<head>
<title>NPAPI Cookie Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement = document.getElementById("plugin1");
var c = 0;
var foundSetColor = false;
for (var n in pluginElement) {
++c;
ok(n in pluginElement, "Enumerated property which doesn't exist?");
if (n == 'setColor')
foundSetColor = true;
}
ok(c > 0, "Should have enumerated some properties");
ok(foundSetColor, "Should have enumerated .setColor");
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
</body>
</html>
<html>
<head>
<title>NPAPI Cookie Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement = document.getElementById("plugin1");
var c = 0;
var foundSetColor = false;
for (var n in pluginElement) {
++c;
ok(n in pluginElement, "Enumerated property which doesn't exist?");
if (n == 'setColor')
foundSetColor = true;
}
ok(c > 0, "Should have enumerated some properties");
ok(foundSetColor, "Should have enumerated .setColor");
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
</body>
</html>
@@ -3,7 +3,7 @@
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
@@ -3,7 +3,7 @@
<head>
<title>Test for Login Manager</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
@@ -5,7 +5,7 @@
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
</head>
<body onload="begin()">
<script type="application/javascript;version=1.8">
@@ -4,7 +4,7 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
@@ -4,7 +4,7 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
@@ -4,7 +4,7 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
@@ -1,33 +1,33 @@
<head>
<title>Plugin instantiation</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="mainLoaded()">
<iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var iframe = document.getElementById('iframe1');
function mainLoaded() {
var p = iframe.contentDocument.createElement('embed');
p.setAttribute('id', 'plugin1');
p.setAttribute('type', 'application/x-test');
p.setAttribute('width', '400');
p.setAttribute('height', '400');
p.setAttribute('drawmode', 'solid');
p.setAttribute('color', 'FF00FFFF');
iframe.contentDocument.body.appendChild(p);
// Plugin instantiation happens asynchronously
SimpleTest.executeSoon(function() {
SimpleTest.executeSoon(function() {
ok(p.setColor !== undefined, "Dynamic plugin instantiation.");
SimpleTest.finish();
})
});
}
</script>
<head>
<title>Plugin instantiation</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body onload="mainLoaded()">
<iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var iframe = document.getElementById('iframe1');
function mainLoaded() {
var p = iframe.contentDocument.createElement('embed');
p.setAttribute('id', 'plugin1');
p.setAttribute('type', 'application/x-test');
p.setAttribute('width', '400');
p.setAttribute('height', '400');
p.setAttribute('drawmode', 'solid');
p.setAttribute('color', 'FF00FFFF');
iframe.contentDocument.body.appendChild(p);
// Plugin instantiation happens asynchronously
SimpleTest.executeSoon(function() {
SimpleTest.executeSoon(function() {
ok(p.setColor !== undefined, "Dynamic plugin instantiation.");
SimpleTest.finish();
})
});
}
</script>
@@ -2,7 +2,7 @@
<head>
<title>Test mixed case mimetype for plugins</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script>
SimpleTest.expectAssertions(0, 1);
@@ -1,7 +1,7 @@
<head>
<title>NPNV*NPObject accessibility tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
@@ -1,7 +1,7 @@
<head>
<title>NPN_GetURL called from NPP_Destroy</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
@@ -3,7 +3,7 @@
<title>NPN_AsyncCallback Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -3,7 +3,7 @@
<title>NPN_Timer Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -1,7 +1,7 @@
<head>
<title>NPNV*NPObject accessibility tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
@@ -6,7 +6,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -1,32 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>Test whether windowless plugins receive correct visible/invisible notifications.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<p id="display"></p>
<embed id="theplugin" type="application/x-test"></embed>
<script type="application/javascript">
function MyFunc(arg) {
is(arg, "hi", "Argument passed to constructor function");
this.localProp = 'local';
}
MyFunc.prototype.protoProp = 't';
var theplugin = document.getElementById('theplugin');
ok(theplugin.constructObject(Array) instanceof Array, "Constructed Array");
var o = theplugin.constructObject(MyFunc, "hi");
ok(o instanceof MyFunc, "Constructed MyFunc");
is(o.localProp, 'local', "this property correct");
is(o.protoProp, 't', "prototype property correct");
</script>
<!DOCTYPE html>
<html>
<head>
<title>Test whether windowless plugins receive correct visible/invisible notifications.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<p id="display"></p>
<embed id="theplugin" type="application/x-test"></embed>
<script type="application/javascript">
function MyFunc(arg) {
is(arg, "hi", "Argument passed to constructor function");
this.localProp = 'local';
}
MyFunc.prototype.protoProp = 't';
var theplugin = document.getElementById('theplugin');
ok(theplugin.constructObject(Array) instanceof Array, "Constructed Array");
var o = theplugin.constructObject(MyFunc, "hi");
ok(o instanceof MyFunc, "Constructed MyFunc");
is(o.localProp, 'local', "this property correct");
is(o.protoProp, 't', "prototype property correct");
</script>
@@ -1,67 +1,67 @@
<html>
<head>
<title>NPN_Invoke Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<script class="testbody" type="application/javascript">
////
// This test exercises NP identifiers by querying the reflector to make sure
// that identifiers are translated to values correctly.
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var testsRun = 0;
function doTest() {
SpecialPowers.gc();
var reflector = document.getElementById("subframe").contentDocument.getElementById("plugin1").getReflector();
var i, prop, randomnumber;
for (i = 0; i < 20; ++i) {
randomnumber=Math.floor(Math.random()*1001);
prop = "prop" + randomnumber;
is(reflector[prop], prop, "Property " + prop);
}
for (i = -10; i < 0; ++i) {
is(reflector[i], String(i), "Property " + i);
prop = "prop" + i;
is(reflector[prop], prop, "Property " + prop);
}
for (i = 0; i < 10; ++i) {
is(reflector[i], i, "Property " + i);
prop = "prop" + i;
is(reflector[prop], prop, "Property " + prop);
}
is(reflector.a, 'a', "Property .a");
is(reflector['a'], 'a', "Property ['a']");
reflector = null;
SpecialPowers.gc();
++testsRun;
if (testsRun == 3) {
SimpleTest.finish();
}
else {
document.getElementById('subframe').contentWindow.location.reload(true);
}
}
</script>
<iframe id="subframe" src="npruntime_identifiers_subpage.html" onload="doTest()"></iframe>
</body>
</html>
<html>
<head>
<title>NPN_Invoke Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<script class="testbody" type="application/javascript">
////
// This test exercises NP identifiers by querying the reflector to make sure
// that identifiers are translated to values correctly.
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var testsRun = 0;
function doTest() {
SpecialPowers.gc();
var reflector = document.getElementById("subframe").contentDocument.getElementById("plugin1").getReflector();
var i, prop, randomnumber;
for (i = 0; i < 20; ++i) {
randomnumber=Math.floor(Math.random()*1001);
prop = "prop" + randomnumber;
is(reflector[prop], prop, "Property " + prop);
}
for (i = -10; i < 0; ++i) {
is(reflector[i], String(i), "Property " + i);
prop = "prop" + i;
is(reflector[prop], prop, "Property " + prop);
}
for (i = 0; i < 10; ++i) {
is(reflector[i], i, "Property " + i);
prop = "prop" + i;
is(reflector[prop], prop, "Property " + prop);
}
is(reflector.a, 'a', "Property .a");
is(reflector['a'], 'a', "Property ['a']");
reflector = null;
SpecialPowers.gc();
++testsRun;
if (testsRun == 3) {
SimpleTest.finish();
}
else {
document.getElementById('subframe').contentWindow.location.reload(true);
}
}
</script>
<iframe id="subframe" src="npruntime_identifiers_subpage.html" onload="doTest()"></iframe>
</body>
</html>
@@ -3,7 +3,7 @@
<title>NPN_Evaluate Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -3,7 +3,7 @@
<title>NPN_Invoke Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -3,7 +3,7 @@
<title>NPN_Invoke_Default Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -38,7 +38,7 @@
</head>
<body onload="initialize()">
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
@@ -3,7 +3,7 @@
<head>
<title>Test that scrolling a windowless plugin doesn't force us to repaint it</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
<title>Test Modifying Plugin click-to-play Flag</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
</head>
<body>
<script class="testbody" type="application/javascript">
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -9,7 +9,7 @@ Tests for plugin stream error conditions.
<title>NPAPI Stream Error Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -5,7 +5,7 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
@@ -2,7 +2,7 @@
<title>Do plugin stream requests send the Referer header correctly?</title>
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />

Some files were not shown because too many files have changed in this diff Show More